Pen-shaped handwriting input apparatus using accelerometers and gyroscopes and an associated operational device for determining pen movement

ABSTRACT

A small-sized pen-shaped input apparatus precisely detects handwriting input. The apparatus compensates for the effects of the inclination of the pen-shaped input apparatus. An initial inclination angle calculating section calculates the initial value of the inclination angle of a pen shaft in a gravity coordinate system. The inclination angle variation calculating section calculates a variation value of the inclination angle of the pen shaft. A handwriting inclination angle calculating section calculates the inclination angle of the pen shaft when writing. A coordinates conversion calculating section converts the coordinate system of the acceleration from the pen shaft coordinate system to the gravity coordinate system. A movement amount calculating section calculates the movement direction and the movement distance of the pen&#39;s tip end. Finally, a handwriting detecting section detects a state of handwriting or non-handwriting.

This application is a divisional of application Ser. No. 08/803,395filed Feb. 20, 1997, now U.S. Pat. No. 5,902,968, which is herebyincorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a pen-shaped input apparatus forinputting figures, symbols, characters and the like into a dataprocessing device, such as a computer.

2. Description of the Related Art

Conventionally, a keyboard, mouse, digitizer, light pen, and tablet,etc. have been used as an input apparatus employed in a computerapparatus or the like. Such computer apparatus needs to be small-sized,and there is a growing need for a portable terminal instrument as thenumber of users increases year by year. Consequently, a small-size inputapparatus is also required.

There is a limitation on making the keyboard small-sized from theviewpoint of the human interface, and a keyboard is not a practicalinput apparatus for a portable terminal instrument. Furthermore,although the mouse can be made in a small-size and used as a pointingdevice, it is not suitable for inputting figures and characters, etc.into a data processor.

For this reason, on many occasions, a pen-shaped input apparatusemploying a tablet and pen have been adopted as the input apparatus fora portable terminal instrument. However, it is difficult to reduce thesize of the tablet.

To overcome the problem of tablet size, tabletless input apparatuseshave been developed such as, for instance, a pen-shaped computer inputapparatus as disclosed in Japanese Laid-open Patent Publication No.6-67799/1994, a data input apparatus as disclosed in Japanese Laid-openPatent Publication No. 7-84716/1995, a handwriting input apparatus asdisclosed in Japanese Laid-open Patent Publication No. 7-200127/1995,and a pencil-shaped input apparatus as disclosed in Japanese Laid-openPatent Publication No. 6-230886/1994.

The pen-shaped computer input apparatus disclosed in Japanese Laid-openPatent Publication No. 6-67799/1994 senses the movement direction andthe movement amount of the input apparatus by use of an accelerationsensor and then compensates for an influence exerted on the movementdirection and the movement amount sensed by the acceleration sensor bythe action of the pen-shaped computer input apparatus' rotation by useof a piezoelectric vibration gyroscope.

Furthermore, the data input apparatus disclosed in Japanese Laid-openPatent Publication No. 7-84716/1995 senses the movement direction andthe movement amount of the apparatus on the basis of signals showing thepolarity and the amplitude respectively transmitted from vibrationgyroscopes perpendicularly disposed to each other.

Furthermore, the handwriting input apparatus disclosed in JapaneseLaid-open Patent Publication No. 7-200127/1995 obtains a movementdirection and a movement distance (amount) on the basis of the signalsrespectively transmitted from two acceleration sensors.

Furthermore, the pencil-shaped input apparatus disclosed in JapaneseLaid-open Patent Publication No. 6-230886/1994 disposes a couple ofacceleration sensors on different positions of the pen shaft, andobtains a movement direction and a movement distance of the pen's tipend. In this apparatus, the influence due to the mounting position ofthe acceleration sensors is compensated on the basis of the output fromthe couple of acceleration sensors.

And further, a position sensor disclosed in the published specificationof Japanese Laid-open Patent Publication No. 7-294240/1995, which doesnot directly relate to the pen-shaped input apparatus is used, forinstance, in a game machine for sensing the moving speed, position andattitude of the head portion of human body, and the position sensorcomprises acceleration sensors for respectively sensing theaccelerations in the X-axis direction, the Y-axis direction, and theZ-axis direction and gyroscopes for respectively sensing the angularvelocities around the X axis, the Y axis, and the Z axis. This apparatusperforms a strap-down type operational calculation on the basis of theaccelerations and the angular velocities detected by those sensors anddetects the moving speed, position, attitude, and direction of the headportion of the human body.

SUMMARY OF THE INVENTION

Since the pen-shaped computer input apparatus disclosed in JapaneseLaid-open Patent Publication No. 6-67799/1994 compensates only foreffects due to the rotation of the apparatus, it can not compensate foreffects caused by dynamic inclination. At the time of performing anordinary handwriting operation, the apparatus may be accompanied with adynamic inclination and therefore the result of detection is not preciseon some occasions.

Furthermore, since the data input apparatus disclosed in JapaneseLaid-open Patent Publication No. 7-84716/1995 detects the rotationalmovement of the wrist and inputs the movement direction and the movementdistance in accordance with the detected result, the data inputapparatus is not suitable for inputting figures, and the like.

Furthermore, the handwriting input apparatus disclosed in JapaneseLaid-open Patent Publication No. 7-200127/1995 does not comprise anycompensation medium for compensating for the inclination and therotation of the apparatus, and therefore the detection result is notprecise on some occasions.

Furthermore, since the pencil-shaped input apparatus disclosed inJapanese Laid-open Patent Publication No. 6-230886/1994 does not takeinto consideration the fact that the component for the rotational angleof the apparatus is contained in the acceleration detected by theacceleration sensor, the detection error of the movement distancebecomes large on some occasions.

Moreover, since the position sensor disclosed in Japanese Laid-openPatent Publication No. 7-294240/1995 specially detects the movingvelocity, position, attitude, and direction of the head portion,although the sensor performs a complicated operational calculation, themovement direction and the movement distance on the handwriting surfacehas to be detected precisely using a simple operational calculatingprocess because of the requirement of making the apparatus small-sized.

Furthermore, in the case of employing the position sensor as disclosedin Japanese Laid-open Patent Publication No. 7-294240/1995 the threeacceleration sensors cannot be arranged at the pen's tip end, andtherefore an error occurs due to the difference between the mountingpositions of the pen's tip end and the acceleration sensor. Therefore,the handwriting input cannot be detected precisely on some occasions.

The present invention has been made in consideration of the foregoingproblems.

Thus, one object of the present invention to overcome the problemsmentioned above.

Another object of the present invention to eliminate the defects in theexisting devices mentioned above.

Still another object of the present invention is to provide asmall-sized pen-shaped input apparatus.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete appreciation of the present invention and many of theattendant advantages thereof will be readily obtained as the samebecomes better understood by reference to the following detaileddescription when considered in connection with the accompanyingdrawings, wherein:

FIG. 1 is a structural view showing a first embodiment according to thepresent invention;

FIG. 2 is a block diagram showing the circuit of an operationalcalculating section of the first embodiment;

FIG. 3 is a flow chart showing the operation of a pen-shaped inputapparatus of the first embodiment;

FIG. 4 is a side view of the pen-shaped input apparatus in which thehandwriting surface is not horizontal;

FIG. 5 is a block diagram showing the circuit of the operationalcalculating section which includes an acceleration compensating section;

FIG. 6 is an explanatory diagram showing the variation of an inclinationangle of the pen-shaped input apparatus;

FIG. 7 is an explanatory diagram showing the coordinates difference incase that the coordinate system of the pen shaft does not coincide withthe coordinate system of the handwriting surface;

FIG. 8 is a perspective view of another pen-shaped input apparatus whichis a modification of the first embodiment according to the presentinvention;

FIG. 9 is a block diagram of an operational calculating section of thepen-shaped input apparatus of the modification;

FIG. 10 is a structural view showing a second embodiment according tothe present invention;

FIG. 11 is a block diagram showing the circuit of an operationalcalculating section of the second embodiment;

FIG. 12 is a diagram showing a waveform of an acceleration signal;

FIG. 13 is a side view of a pen-shaped input apparatus of the secondembodiment showing one point on the pen-shaped input apparatus;

FIG. 14 is a flow chart showing the operation of the pen-shaped inputapparatus;

FIG. 15 is perspective view of a handwriting surface, wherein

FIG. 15a shows three-dimensional data of the handwriting orbit and

FIG. 15b shows an error thereof;

FIG. 16 is an explanatory diagram for explaining an f₁₃-component;

FIG. 17 is an explanatory diagram for explaining an f₂₃-component;

FIG. 18 is an explanatory diagram for explaining an f₃₃-component;

FIG. 19 is a perspective view of a handwriting surface where theshortest distance between the pen-shaped input apparatus and the surfaceto be handwritten is made in the direction of Zg axis;

FIG. 20 is a structural view showing a third embodiment according to thepresent invention;

FIG. 21 is a block diagram showing the circuit of an operationalcalculating section of the third embodiment;

FIG. 22 is a block diagram showing the structure of the handwritingdetecting section;

FIG. 23 is a flow chart showing the operation of the pen-shaped inputapparatus;

FIG. 24 is a waveform diagram showing the acceleration signal in thecase of drawing a circle mark;

FIG. 25 is a waveform diagram of the acceleration signal in the staticstate;

FIG. 26 is a structural view showing an operational calculating sectionfor calculating the initial rotational angle by use of the averagevalue;

FIG. 27 is a structural view showing an initial rotational anglecalculating section for calculating the initial rotational angle by useof the average value;

FIG. 28 is a flow chart showing the operation of calculating the initialrotational angle;

FIG. 29 is a structural view showing an operational calculating sectionincluding an alarming section;

FIG. 30 is a block diagram showing the construction of a variationamount comparing section;

FIG. 31 is a waveform diagram representing the relationship between thevariation amount of the acceleration and a threshold value;

FIG. 32 is a structural view showing the pen-shaped input apparatusincluding a pressure sensor;

FIG. 33 is graph showing the variation of the acceleration, wherein

FIG. 33a is a graph showing the variation thereof in a wide range and

FIG. 33b is another graph showing the variation thereof partly enlargedin the area encircled by the dotted line in FIG. 33a;

FIG. 34 is a diagram generally illustrating the Eulerian angles; and

FIG. 35 is a diagram explaining the coordinates of the pen shaft.

DETAILED DESCRIPTION OF THE INVENTION

A. Explanation of Coordinate Systems

Prior to the explanation of the first through third embodiments, theconcept of the gravity coordinate system and the pen shaft coordinatesystem is described here, particularly with respect to the frame ofreference transformation, and the definition of “Eulerian” angles as tothe pen motion, shown in FIG. 34.

The definition of two frames of reference are a laboratory frame (Xg,Yg, Zg) and a pen frame (Xs, Ys, Zs). The former relates to the gravitycoordinate system while the latter relates to the pen shaft coordinatesystem. FIG. 34 shows the steps of converting the gravity coordinatesystem for the pen-shaped inputting system to the pen shaft coordinatesystem.

The definition of the Eulerian angles (ψ,θ,φ) can be respectivelyexpressed by the following three matrix equations (1), (2), and (3):

ψ: rotating (Xg, Yg, Zg) around Zg, define the angle until Xg axis goesacross the Zg-Xs flat. Then (X₁, Y₁, Z₁) is formed. $\begin{matrix}{\begin{bmatrix}X_{1} \\Y_{1} \\Z_{1}\end{bmatrix} = {\begin{bmatrix}{\cos \quad \psi} & {\sin \quad \psi} & 0 \\{{- \sin}\quad \psi} & {\cos \quad \psi} & 0 \\0 & 0 & 1\end{bmatrix}\quad\begin{bmatrix}{Xg} \\{Yg} \\{Zg}\end{bmatrix}}} & (1)\end{matrix}$

θ: rotating around the Y₁ newly formed axis, define the angle until theX₁ axis is in accord with the Xs axis. Then (X₂, Y₂, Z₂) is formed.$\begin{matrix}{\begin{bmatrix}X_{2} \\Y_{2} \\Z_{2}\end{bmatrix} = {\begin{bmatrix}{\cos \quad \theta} & 0 & {{- \sin}\quad \theta} \\0 & 1 & 0 \\{\sin \quad \theta} & 0 & {\cos \quad \theta}\end{bmatrix}\quad\begin{bmatrix}X_{1} \\Y_{1} \\Z_{1}\end{bmatrix}}} & (2)\end{matrix}$

φ: rotating around the X₂ axis, define the angle Xs and Zs according toeach other. Then (Xs, Ys, Zs), that is the pen frame, is formed.$\begin{matrix}{\begin{bmatrix}{Xs} \\{Ys} \\{Zs}\end{bmatrix} = {\begin{bmatrix}1 & 0 & 0 \\0 & {\cos \quad \varphi} & {\sin \quad \varphi} \\0 & {{- \sin}\quad \varphi} & {\cos \quad \varphi}\end{bmatrix}\quad\begin{bmatrix}X_{2} \\Y_{2} \\Z_{2}\end{bmatrix}}} & (3)\end{matrix}$

FIG. 35 shows the coordinates of the pen shaft of the pen-shaped inputapparatus in the case of putting the pen shaft vertically and on a fixedpoint and in the case of putting the pen shaft on an optional point asorigin in a state of being inclined when the handwriting operation isperformed.

The details of the relationship between the respective coordinates andthe movement of the pen shaft are described hereinafter, referring tothe first, second, and third embodiments according to the presentinvention.

B. Detailed Description of the First Embodiment and Its Modification.

The pen-shaped input apparatus of the first embodiment according to thepresent invention comprises three acceleration sensors, three gyroscopesand an operational calculating section. The three acceleration sensorsrespectively detect the accelerations in the X-axis, Y-axis, and Z-axisdirections of the pen-shaft coordinate system around the Z axis of thepen shaft. The three gyroscopes respectively detect the angular velocityaround the X axis, Y axis, and Z axis. The operational calculatingsection comprises an initial inclination angle calculating section, aninclination angle variation calculating section, a handwritinginclination angle calculating section, a coordinates conversioncalculating section, and a movement amount calculating section.

The initial inclination angle calculating section calculates the initialvalue of the pen shaft inclination angle in the gravity coordinatesystem around a Z axis which extends in the gravity accelerationdirection (vertically) on the basis of the accelerations detected by thethree acceleration sensors when the pen shaped input apparatus is in astate of non-handwriting.

The inclination angle variation calculating section calculates thevariation of the inclination angle of the pen shaft in the gravitycoordinate system on the basis of the angular velocities detected by thethree gyroscopes when the pen shaped input apparatus is in a state ofhandwriting.

The handwriting inclination angle calculating section calculates theinclination angle of the handwriting pen shaft in the gravity coordinatesystem on the basis of the initial value of the inclination anglecalculated by the initial inclination angle calculating section and thevariation of the inclination angle calculated by the inclination anglevariation calculating section.

The coordinates conversion calculating section converts the accelerationin the pen shaft coordinate system detected by the acceleration sensorto the acceleration in the gravity coordinate system on the basis of theinclination angle of the handwriting pen shaft in the gravity coordinatesystem calculated by the handwriting inclination angle calculatingsection.

The movement amount calculating section calculates the movementdirection and the movement distance of the pen's tip end on the basis ofthe acceleration converted by the coordinates conversion calculatingsection and thereby the movement direction and the movement distance ofthe tip end of the small-sized pen moving on the handwriting surface.

Furthermore, the movement distance of the pen's tip end calculated bythe movement amount calculating section on the basis of the inclinationto the gravity coordinate system on the handwriting surface iscompensated to the movement distance on the handwriting surface, andthereby even when the handwriting surface is not horizontal, themovement direction and the movement distance of the pen's tip end can bedetected precisely.

Furthermore, there are provided by-pass filters transmitting thehigh-frequency component of the signals of the three accelerationsensors and the three gyroscopes at frequencies above the neighborhoodof 10 Hz. The actual frequencies of interest are frequencies caused byfriction between the writing pen and writing surface which occur about100 Hz. Other frequencies, caused by the movement of the writingimplement which occur at or about 5 Hz are excluded by the 10 Hz cutoff.The beginning of handwriting is judged on the basis of the presence ofthe signal containing the high-frequency component at the beginning ofany one of the signals from the three acceleration sensors and the threegyroscopes passing through the high-pass filters. In such manner, thestart of the handwriting can be detected precisely. Likewise, when thehigh frequency component is absent from all the signals from theacceleration sensors and gyroscopes, for a threshold period of time,this indicates the ending of a handwriting operation.

Furthermore, there is provided an acceleration compensation section forcalculating the value of the acceleration variation due to theinclination angle variation on the basis of the variation of theinclination angle in the gravity coordinate system of the handwritingpen shaft detected by the inclination angle variation and the positionof mounting the acceleration sensor, and compensating the accelerationdetected by the acceleration sensor, and the coordinates calculatingsection converts the acceleration compensated by the accelerationcompensating section to the acceleration in the gravity coordinatesystem. In such manner, the influence due to the variation of theinclination angle during the time period of handwriting is eliminated.

Furthermore, the acceleration compensating section calculates acentrifugal force due to the variation of the inclination angle appliedto the acceleration sensor on the basis of the speed variation of theinclination angle in the gravity coordinate system of the handwritingpen shaft detected by the inclination angle variation calculatingsection and the position of mounting the acceleration sensor. And then,the value of the acceleration variation due to the inclination anglevariation is compensated on the basis of the above calculatedcentrifugal force, the acceleration detected by the acceleration sensoris compensated thereby, and the component of the centrifugal force dueto the inclination angle variation of the acceleration detected by theacceleration sensor is compensated, and thereby the component of thecentrifugal force accompanying the inclination angle variation of theacceleration detected by the acceleration sensor is also compensated.

Furthermore, the difference between the coordinates of the location ofthe acceleration sensors relative to the handwriting surface and thecoordinates of the pen's tip end is compensated on the basis of theinclination angle in the gravity coordinate system of the handwritingdetected by the handwriting inclination angle calculating section. Insuch manner, the entire input figure can be prevented from beingdeviated (shifted).

And further, the pen-shaped input apparatus comprises an apparatus mainbody and an inclination angle detecting apparatus for detecting theinclination angle of the pen shaft: in the gravity coordinate system.The apparatus main body comprises three acceleration sensors and anoperational calculating section. The three acceleration sensors detect,respectively, the accelerations in the X-axis direction, the Y-axisdirection, and the Z-axis direction of the pen shaft coordinates systemin which the pen shaft is the Z axis.

The operational calculating section comprises a coordinates conversioncalculating section and a movement amount calculating section. Thecoordinates conversion calculating section converts the accelerationobtained in accordance with the pen shaft coordinates system to anacceleration in the gravity coordinate system the on the basis of theinclination angle of the pen shaft in the gravity coordinate system asmeasured by the inclination angle detecting apparatus. The movementamount calculating section calculates the movement direction and themovement distance of the pen's tip end on the basis of the accelerationas converted by the coordinates conversion calculating section. In suchmanner, the construction of the apparatus main body can be simplifiedand the accuracy of detecting the inclination angle can be raised at thesame time.

Moreover, the handwriting state may be judged in the pen-shaped inputapparatus by use of an enable switch, etc. instead of on the basis ofthe presence of the high frequency components of the signals from theacceleration sensors and the gyroscopes. When the latter technique isused, the pen-shaped input apparatus uses a by-pass filter transmittingthe high-frequency component of the signals from the accelerationsensors and the gyroscopes above the neighborhood of a frequency near 10Hz. As noted, the actual frequencies of interest are about 10 Hz. Sincethe high-frequency component of the signals from the accelerationsensors, etc. is generated by the action of the friction between thepen's tip end and the handwriting surface and the frequency thereof isabove the neighborhood of 10 Hz, the pen-shaped input apparatus judges,as “handwriting”, the time period when the above-mentionedhigh-frequency component is detected in any one of the signals from thethree acceleration sensors and the three gyroscopes. In such manner,operational errors can be prevented and the start of the handwriting canbe detected precisely. The end of the handwriting can be detected whenthe high frequency component is no longer present in any of the signalsfrom the acceleration sensors and gyroscopes for a threshold period oftime.

And further, the pen-shaped input apparatus may be divided into a mainbody and the inclination angle detecting apparatus for detecting theinclination angle between the handwriting surface and the apparatus mainbody disposed just above the handwriting surface.

FIG. 1 is a structural view showing a pen-shaped input apparatus of afirst embodiment according to the present invention. As shown in FIG. 1,the pen-shaped input apparatus 1 comprises acceleration sensors 2 a, 2b, and 2 c, gyroscopes 3 a, 3 b, and 3 c, an operational calculatingsection 4, a memorizing section 5, and a power supply section 6.

The acceleration sensors 2 a, 2 b, and 2 c are respectively disposed inthe directions of Xs axis, Ys axis, and Zs axis, all of which areintersected perpendicularly to each other, wherein the pen shaftcoincides with the Zs axis, and the sensors 2 a, 2 b, and 2 c detect,respectively, the accelerations in the Xs-axis, Ys-axis, and Zs-axisdirections at the pen's tip end 8. A piezo-electric type sensor or anelectrostatic capacitance type sensor may be used as the accelerationsensors 2 a, 2 b, and 2 c as well as a piezo-electric resistance typesensor. The gyroscopes 3 a, 3 b, and 3 c respectively detect the angularvelocities around the Xs axis, the Ys axis, and the Zs axis.

In the following description, the coordinate system of the pen shaft 7coinciding with the Zs axis is called the pen shaft coordinate system,and the two axes both intersected perpendicularly to the pen shaft 7 andto each other are respectively called the Xs axis and the Ys axis.

And further, the coordinate system having a Zg axis extending in thegravity acceleration direction (vertically) is called the gravitycoordinates system and the two axes intersected perpendicularly to theZg axis and to each other are respectively called the Xg axis and the Ygaxis. Furthermore, the angles formed between the Xs axis and the Ysaxis, between the Zs axis and the Xg axis, and between the Yg axis andZg axis are respectively specified as θ, φ, and ψ.

As shown in FIG. 2, the operational calculating section 4 comprises A/Dconverters 41 a-41 f, low-pass filters 42 a-42 f, a high-pass filter 43,an initial inclination angle calculating section 44, an inclinationangle variation calculating section 45, a handwriting inclinationcalculating section 46, a coordinates conversion calculating section 47,and a movement amount calculating section 48.

The A/D converters 41 a-41 f respectively convert the analog signalsfrom the acceleration sensors 2 a, 2 b, and 2 c, and the gyroscopes 3 a,3 b, and 3 c to digital signals. The low-pass filters 42 a-42 fintercept the high-frequency component of the signals from theacceleration sensors 2 a, 2 b, and 2 c and the gyroscopes 3 a, 3 b, and3 c caused by the action of the friction force between the pen's tip end8 and the handwriting surface. The high-pass filter 43 extracts, forinstance, the high-frequency component, above the neighborhood of 10 Hz,of the signals from the acceleration sensors 2 a, 2 b, and 2 c and thegyroscopes 3 a, 3 b, and 3 c caused by the action of the friction force.This high frequency component, when present, indicates the beginning ofa writing condition. Before the high frequency component occurs, itsabsence indicates that a handwriting operation has not yet begun. Inaddition, once the high frequency component appears, its later absencefrom the acceleration sensor and gyroscope signals for a thresholdperiod indicates that a writing condition has ended.

The initial inclination angle calculating section 44 calculates theinitial values θ₀, φ₀, and ψ₀ of the inclination angles in the gravitycoordinate system of the pen shaft 8 on the basis of the acceleration inthe pen shaft coordinate system detected by the three accelerationsensors 2 a, 2 b, and 2 c in a state of non-handwriting.

The inclination angle variation calculating section 45 calculates thevariations Δθ, Δφ, and Δψ of the inclination angle in the gravitycoordinate system of the pen shaft 8 on the basis of the angularvelocity detected by the three gyroscopes 3 a, 3 b, and 3 c in a stateof handwriting. The handwriting inclination angle calculating section 46obtains the inclination angles θ, φ, and ψ in the gravity coordinatesystem of the handwriting pen shaft 8 on the basis of the initial valuesθ₀, φ₀, and ψ₀ of the inclination angle in the gravity coordinate systemof the pen shaft 8 calculated by the initial inclination anglecalculating section 44, and the variations Δθ₀, Δφ, and Δψ of theinclination angle in the gravity coordinate system of the pen shaft 8calculated by the inclination angle variation calculating section 45.The coordinates conversion calculating section 47 converts theacceleration in the pen shaft coordinate system detected by theacceleration sensors 2 a, 2 b, and 2 c to the acceleration in thegravity coordinate system on the basis of the inclination angles θ, φ,and ψ in the gravity coordinate of the handwriting pen shaft 8 detectedby the handwriting inclination angle calculated by the handwritinginclination angle calculating section 46.

The movement amount calculating section 48 calculates the movementdirection and the movement distance of the pen's tip end 8 on the basisof the acceleration in the gravity coordinate system thus converted bythe coordinates conversion calculating section 47 and the section 48stores the calculated values in the storage section 5.

The operation of the pen-shaped input apparatus 1 constructed asmentioned above is described referring to the flow chart of FIG. 3.

The acceleration sensors 2 a, 2 b, and 2 c respectively detect theaccelerations in the Xs direction, the Ys direction, and the Zsdirection. The high-pass filter 43 extracts the high-frequency componentof the signals from the acceleration sensors 2 a, 2 b, and 2 c and thegyroscopes 3 a, 3 b, and 3 c inputted through the A/D converters 41 a-41f, all of which exceed the neighborhood of 10 Hz.

In such manner, the high-frequency signals caused by the action of thefriction force between the pen's tip end 8 and the handwriting surfaceare detected respectively, and thereby a judgment can be made on whetherthe input apparatus is in the state of “handwriting” or“not-handwriting”. Therefore, it is possible to detect easily andprecisely the state of handwriting or not-handwriting.

The initial inclination angle calculating section 44 respectively inputsthe signals from the acceleration sensor 2 a for the Xs axis, theacceleration sensor 2 b for the Ys axis, and the acceleration sensor 2 cfor the Zs axis when it does not receive the signal showing the state of“handwriting” from the by-pass filter, and calculates the initial valuesθ₀, φ₀, and ψ₀ of the inclination angles in the gravity coordinatesystem of the pen shaft 8 (Step S1).

Hereupon, the calculation of the afore-mentioned inclination angle isdescribed hereinafter. The conversion from the gravity coordinatessystem to the pen shaft coordinates system can be performed inaccordance with the following equation: $\begin{matrix}{\begin{pmatrix}{Xs} \\{Ys} \\{Zs}\end{pmatrix} = {\begin{pmatrix}{{\cos \quad \theta \quad \cos \quad \psi}\quad} & {\cos \quad \theta \quad \sin \quad \psi} & {{- \sin}\quad \theta} \\{{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\cos \quad \varphi \quad \sin \quad \psi}} & {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}} & {\sin \quad \varphi \quad \cos \quad \theta} \\{{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\sin \quad \varphi \quad \sin \quad \psi}} & {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\sin \quad \varphi \quad \cos \quad \psi}} & {\cos \quad \varphi \quad \cos \quad \theta}\end{pmatrix}\quad ( \begin{matrix}{Xg} \\{Yg} \\{Zg}\end{matrix}\quad )}} & (4)\end{matrix}$

The equation (equation 4) can be changed from the conversion formula ofthe pen shaft coordinate system to that of the gravity coordinatesystem, and thereby the following equation (equation 5) can be obtained.$\begin{matrix}{\begin{pmatrix}{Xg} \\{Yg} \\{Zg}\end{pmatrix} = {\begin{pmatrix}{\cos \quad \theta \quad \cos \quad \psi} & {{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\cos \quad \varphi \quad \sin \quad \psi}} & {{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\sin \quad \varphi \quad \sin \quad \psi}} \\{\cos \quad \theta \quad \sin \quad \psi} & {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}} & {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\sin \quad \varphi \quad \cos \quad \psi}} \\{{- \sin}\quad \theta} & {\sin \quad \varphi \quad \cos \quad \theta} & {\cos \quad \varphi \quad \cos \quad \theta}\end{pmatrix}\quad ( \begin{matrix}{Xs} \\{Ys} \\{Zs}\end{matrix}\quad )}} & (5)\end{matrix}$

The above equation (equation 5) is approximated with a first-order(linear) approximation formula and converted to the acceleration vectorequation, and thereby the following two equations (equations 6a,6b) canbe obtained. Hereupon, it is assumed that the acceleration vectorsdetected by the acceleration sensors 2 a, 2 b, and 2 c in the pen shaftcoordinate system are, respectively, Axs, Ays, and Azs, while theacceleration vectors detected by the acceleration sensors 2 a, 2 b, and2 c in the gravity coordinate system are Axg, Ayg, and Azg.$\begin{matrix}{\begin{pmatrix}{Axs} \\{Ays} \\{Azs}\end{pmatrix} = {\begin{pmatrix}{{\cos \quad \theta \quad \cos \quad \psi}\quad} & {\cos \quad \theta \quad \sin \quad \psi} & {{- \sin}\quad \theta} \\{{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\cos \quad \varphi \quad \sin \quad \psi}} & {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}} & {\sin \quad \varphi \quad \cos \quad \theta} \\{{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\sin \quad \varphi \quad \sin \quad \psi}} & {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\sin \quad \varphi \quad \cos \quad \psi}} & {\cos \quad \varphi \quad \cos \quad \theta}\end{pmatrix}\quad ( \begin{matrix}{Axg} \\{Ayg} \\{Azg}\end{matrix}\quad )}} & \text{(6a)} \\{\begin{pmatrix}{Axg} \\{Ayg} \\{Azg}\end{pmatrix} = {\begin{pmatrix}{\cos \quad \theta \quad \cos \quad \psi} & {{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\cos \quad \varphi \quad \sin \quad \psi}} & {{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\sin \quad \varphi \quad \sin \quad \psi}} \\{\cos \quad \theta \quad \sin \quad \psi} & {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}} & {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\sin \quad \varphi \quad \cos \quad \psi}} \\{{- \sin}\quad \theta} & {\sin \quad \varphi \quad \cos \quad \theta} & {\cos \quad \varphi \quad \cos \quad \theta}\end{pmatrix}\quad ( \begin{matrix}{Axs} \\{Ays} \\{Azs}\end{matrix}\quad )}} & \text{(6b)}\end{matrix}$

The acceleration vectors Axs, Ays, and Azs and the inclination angles θ,φ, and ψ are respectively substituted for the above-mentioned tentativeapproximation formula, and thereby acceleration vectors Axg, Ayg, andAzg can be obtained on the handwriting surface.

On the other hand, the acceleration in the static state is expressed bythe following equation (equation 7). $\begin{matrix}{\begin{pmatrix}{Axg} \\{Ayg} \\{Azg}\end{pmatrix} = ( \begin{matrix}0 \\0 \\{- g}\end{matrix}\quad )} & (7)\end{matrix}$

The equation 7 is substituted for the equations 6a, 6b, and thereby thefollowing equation (equation 8) can be obtained. $\begin{matrix}{\begin{pmatrix}{Axs} \\{Ays} \\{Azs}\end{pmatrix} = ( \begin{matrix}{(g)\quad \sin \quad ( {\theta 0} )} \\{{- (g)}\cos \quad ( {\theta 0} )\quad {\sin ( {\varphi 0} )}} \\{{- (g)}\cos \quad ( {\theta 0} )\quad \cos \quad ( {\varphi 0} )}\end{matrix} } & (8)\end{matrix}$

The inclination angles θ₀, φ₀, and ψ₀ in the gravity coordinates systemof the pen shaft 8 put in the static state can be obtained (calculated)from the above equation (equation 8).

Hereupon, since three equations can be established for the inclinationangles θ₀ and φ₀ in the static state, the gravity acceleration “g” canbe treated as an absolute value, and absolute values of the inclinationangles θ₀ and φ₀ in the static state can be calculated without definingthe value of “g”. Furthermore, it may be allowed also to calculate thevalue of the gravity acceleration “g”, judge whether the operationalcalculation is good or bad in accordance with the variation of the valueof the gravity acceleration “g” thus calculated, and issue an alarmsignal, for instance, in case that the calculated value varies largely.

When the inclination angle calculating section 45 receives the signalshowing “handwriting” from the by-pass filter 43 (step S2), thevariations Δθ, Δφ, and Δψ of the inclination angles in the gravitycoordinates system of the en shaft 8 are calculated on the basis of theangular velocities detected by the three gyroscopes 3 a, 3 b, and 3 c(Step S3).

Assuming that the rotational angular velocities of the (angular) axesXs, Ys, and Zs in the pen coordinates are P, Q, and R, the relationshipbetween the rotational angular velocities P, Q, and R and theinclination angle variations Δψ, Δθ, and Δφ can be obtained (calculated)in accordance with the following equations (equations 9).

66 φ=P+Qsinφtanθ+Rcosφtanθ

Δθ=Qcosφ−Rsinφ

Δφ=Qsinφcosθ+Rcosφsecθ  (9

As mentioned above, the handwriting inclination angle calculatingsection 46 obtains (calculates) the inclination angles θ, φ, and ψ ofthe handwriting pen shaft on the basis of the initial values θ₀, φ₀, andψ₀ of the inclinations of the pen shaft 8 calculated by the initialinclination angle calculating section 44 and the inclination anglevariations Δθ, Δφ, and Δψ of the pen shaft 8 calculated by theinclination angle variation calculating section 45 (Step S4).

The coordinates conversion calculating section 47 converts theaccelerations Axs, Ays, and Azs of the pen shaft calculated by theacceleration sensors 2 a, 2 b, and 2 c to the accelerations Axg, Ayg,and Azg in the gravity coordinate system on the basis of the inclinationangle during handwriting detected by the handwriting inclination anglecalculating section 46 (Step S5).

Hereupon, the conversion formula which has been already explained isemployed in order to convert the accelerations Axs, Ays, and Azs in thepen shaft coordinates system to the accelerations Axg, Ayg, and Azg inthe gravity coordinate system.

The movement amount calculating section 48 calculates the movementdirection and the movement distance of the pen's tip end 8 on the basisof the acceleration of the pen's tip end 8 converted by the coordinatesconversion calculating section 47 (Step S6), and stores the values thuscalculated in the storage section 5 (Step S7).

The pen-shaped input apparatus 1 repeats the above-mentioned operations(Steps S3-S7) during the time period of outputting the signal showingthat the high-pass filter 43 is put in the operation of the handwriting,and inputs the figure, etc. (Step S8). In such manner, the figure, etc.can be inputted precisely by compensating the influence exerted on thepen-shaped input apparatus 1 by the inclination angle in the gravitycoordinate system.

Hereupon, although it is assumed that the axis Zg extending in thegravity acceleration direction intersects perpendicularly to thehandwriting surface in the above-mentioned embodiment (firstembodiment), if the handwriting surface is not horizontal, an error mayoccur in the above detection result on some occasions.

For instance, assuming that the axis perpendicular to the handwritingsurface is Zr and the axes intersecting perpendicularly to each other onthe handwriting surface perpendicular to Zr are, respectively, Xr and Yras shown in FIG. 4, the coordinate system established by Xr, Yr, and Zris defined as the handwriting surface coordinates system. Assuming thatthe angle formed by the Xr axis and the Xg axis is q and the deviations(displacements) in the Xg-axis direction and the Zg-axis direction are,respectively, Dx and Dz, the relationship therebetween satisfies thefollowing equation:

θ=arctan (Az/Ax)  (10

And further, the value of Δ(xz) can be obtained by the following twoequations:

Δ(xz)=(Δx)cosθ, and  (11

Δ(xz)=(Δz)sinθ  (12

The movement amount compensating section 49 performs the aboveoperational calculation, wherein it may be allowed to compensate themovement distance in case that the handwriting surface is nothorizontal.

And further, when the inclination angle of the pen-shaped inputapparatus 1 varies during handwriting, the acceleration caused by theinclination angle variation of the pen-shaped input apparatus 1 to theaccelerations applied to the acceleration sensors 2 a, 2 b, and 2 cvaries as the result thereof. An acceleration compensating section 50may also be provided for calculating the variation value of theacceleration caused by the inclination angle variation on the basis ofthe variation value of the inclination angle during handwriting detectedby the handwriting inclination angle calculating section 46 and themounting position of the acceleration sensors 2 a, 2 b, and 2 c, asshown in FIG. 5. For instance, consider the case of rotating thepen-shaped input apparatus by q (radian) in the direction of arrow Baround the pen's tip end, as shown in FIG. 6.

The acceleration sensor 2 is located on the position separated by adistance r1 from the pen's tip end 8. Assuming that the rotationalangular velocity detected by the gyroscope 3 is w (radian), theacceleration a1 applied to the acceleration sensor 2 caused by theinclination thereof turns out to be$({a1}) = {({r1}) \times {\frac{{w(t)}}{t}.}}$

The acceleration compensating section 50 can obtain (calculate) theactual acceleration by subtracting the acceleration a1 applied to theacceleration sensor 2 caused by the above-mentioned inclination from theacceleration detected by the acceleration sensor 2.

Furthermore, when the inclination angle of the pen-shaped inputapparatus 1 varies during handwriting, the centrifugal force occurringat this time exerts an influence on the accelerations detected by theacceleration sensors 2 a, 2 b, and 2 c, on some occasions. On thoseoccasions, it may be allowed to compensate the influence exerted on theaccelerations detected by the acceleration sensors 2 a, 2 b, and 2 c dueto the above-mentioned centrifugal force by use of the accelerationcompensating section 50. For instance, assuming that the accelerationsensor 2 c for detecting the acceleration in the Zs-shaft direction islocated at the position apart by r1 from the pen's tip end, theacceleration caused by the centrifugal force turns out to be −(r1)×w².The acceleration compensation section 50 subtracts the accelerationcaused by the centrifugal force from the acceleration detected by theacceleration sensor 2 c and thereby compensates the detection error.Moreover, although the acceleration in the Zs direction is thuscompensated in the above embodiment (first embodiment), theaccelerations in the Xs axis and the Ys axis can be compensated also ina similar way.

Furthermore, when the pen shaft coordinates system does not coincidewith the handwriting surface coordinates system as shown in FIG. 7, thecoordinates of the origin at the pen's tip end 8 deviates by d andthereby the entire handwritten figure gets out of position on someoccasions. It may be also allowed to obtain (calculate) the deviationvalue d=(r1)×cosθ by use of the coordinates compensating section 51 andthereby compensate the origin coordinates thereof.

C. Modification of First Embodiment

Next, a modification of the first embodiment is described below. In themodification, shown in FIG. 8, the pen-shaped input apparatus 1 b isdivided into the apparatus main body 1 c and the inclination angledetecting apparatus 1 d and both sections are connected to each other bya communication cable 11, and the inclination angle formed between theapparatus main body 1 c and the handwriting surface 10 is detected bythe inclination angle detecting apparatus 1 d mounted on the handwritingsurface 10.

As shown in FIG. 9, the apparatus main body 1 c comprises threeacceleration sensors 2 a, 2 b, and 2 c and an operational calculatingsection 4 b. The three acceleration sensors 2 a, 2 b, and 2 crespectively detect, as described above, the accelerations in the Xsaxis, the Ys axis, and the Zs axis. The operational calculating section4 b comprises a coordinates conversion calculating section 47 and amovement amount calculating section 48. The coordinates conversioncalculating section 47 converts the acceleration in the pen shaftcoordinate system detected by the acceleration sensors 2 a, 2 b, and 2 cto the acceleration in the handwriting surface coordinate system on thebasis of the inclination angle in the handwriting surface coordinatesystem of the handwriting pen shaft 8 detected by the inclination angledetecting apparatus 1 d.

The movement amount calculating section 48 calculates the movementdirection and the movement distance of the pen's tip end 8 on the basisof the acceleration thus converted by the coordinates conversioncalculating section. In such structure, the construction of theapparatus main body 1 c can be simplified and the accuracy of detectingthe inclination angle can be raised.

Regarding the above-mentioned first and modified embodiments, thefollowing advantageous functional effects are acheived. As is apparentfrom the foregoing description of the accelerations in the X-axisdirection, the Y-axis direction, and the Z-axis direction in the case ofassuming that the pen shaft is the Z axis are respectively converted toacceleration(s) in the gravity coordinate system, and then the movementdirection and the movement distance of the pen's tip end are calculatedon the basis of the acceleration thus converted. Consequently, themovement direction and the movement distance of the tip end of the penmoving on the handwriting surface can be detected precisely with asmall-sized apparatus.

Furthermore, since the movement distance of the pen's tip end iscompensated to the movement distance on the handwriting surface on thebasis of the angle formed between the handwriting plane surface and thehorizontal plane surface, the movement direction and the movementdistance of the pen's tip end can be detected precisely even in casethat the handwriting surface is not horizontal.

Furthermore, the high-frequency component of the signal from theacceleration sensors and the gyroscopes above the neighborhood of 10 Hzis transmitted, and the start and end of the handwriting are judged onthe basis of the high-frequency component thus transmitted.Consequently, the start and end of the handwriting can be detectedprecisely.

Furthermore, the variation value of the acceleration due to thevariation of the inclination angle is calculated on the basis of thevariation value of the inclination angle during handwriting and themounting position of the acceleration sensor and the accelerationdetected by the acceleration sensor is compensated. Consequently, theacceleration can be detected precisely.

Furthermore, the centrifugal force caused by the variation of theinclination angle is calculated on the basis of the variation value ofthe inclination angle during the handwriting and the mounting positionof the acceleration sensor and further the variation value of theacceleration due to the variation of the inclination angle on the basisof the calculated centrifugal force, and then the component of thecentrifugal force accompanying the variation of the inclination angle ofthe acceleration detected by the acceleration sensor is compensated.Consequently, the acceleration can be more precisely detected.

Furthermore, the error (difference) between the coordinates of theacceleration on the handwriting plane surface and the coordinates of thepen's tip end is compensated on the basis of the inclination angleduring the handwriting and the mounting position of the accelerationsensor. Consequently, the occurrence of the deviation (getting out ofposition) of the entire inputting figure can be prevented.

And further, since the inclination angle formed between the apparatusmain body and the handwriting surface is detected on the handwritingsurface, the construction of the apparatus main body can be simplifiedand the accuracy of detecting the inclination angle can be raised.

D. Detailed Description of the Second Embodiment

The pen-shaped input apparatus of the second embodiment according to thepresent invention comprises three acceleration sensors, three gyroscopesand an operational calculating section. The three acceleration sensorsrespectively output the signals showing the accelerations in theXs-axis, Ys-axis, and Zs-axis directions of the pen-shaped coordinatesystem (Xs, Ys, Zs) around the Zs axis of the pen shaft. The threegyroscopes respectively output the signals showing the rotationalangular velocity around the Xs axis, Ys axis, and Zs axis.

The operational calculating section comprises an initial inclinationangle calculating section, an inclination angle variation calculatingsection, a handwriting inclination angle calculating section, anacceleration compensating section, a coordinates conversion calculatingsection, and a movement amount calculating section.

The initial inclination angle calculating section calculates the initialvalue of the pen shaft inclination angle in the gravity coordinatesystem (Xg, Yg, Zg) around the Zg axis extending in the gravityacceleration direction on the basis of the acceleration detected by thethree acceleration sensors when the input apparatus is in a state ofnon-handwriting.

The inclination angle variation calculating section calculates thevariation of the inclination angle of the pen shaft in the gravitycoordinate system (Xg, Yg, Zg) on the basis of the rotational angularvelocity detected by the three gyroscopes when the input apparatus is ina state of handwriting.

The handwriting inclination angle calculating section calculates theinclination angle of the handwriting pen shaft in the gravitycoordinates system (Xg, Yg, Zg) on the basis of the initial value of theinclination angle calculated by the initial inclination anglecalculating section and the variation of the inclination anglecalculated by the inclination angle variation calculating section.

The acceleration compensating section compensates the accelerationsensed at the mounting positions of the three acceleration sensors inthe pen shaft coordinates system (Xs, Ys, Zs) to acceleration at thepen's tip end, on the basis of the mounting positions of the threeacceleration sensors, the rotational angular velocity detected by thethree gyroscopes, the inclination angle variation of the pen shaftcalculated by the inclination angle variation calculating section, andthe inclination angle of the handwriting pen shaft calculated by thehandwriting inclination angle calculating section.

The coordinates conversion calculating section converts the accelerationin the pen shaft coordinate system (Xs, Ys, Zs), compensated by theacceleration compensating section, to the acceleration in the gravitycoordinate system (Xg, Yg, Zg), on the basis of the inclination angle inthe gravity coordinate system (Xg, Yg, Zg) of the handwriting pen shaftdetected by the handwriting inclination angle calculating section. Themovement amount calculating section calculates the movement directionand the movement distance of the pen's tip end on the basis of theacceleration converted by the coordinates conversion calculatingsection.

Consequently, the influence exerted by the inclination angle of theapparatus and the mounting position of the acceleration sensors can becompensated, and thereby the handwriting input operation can beperformed more precisely and simply.

The acceleration sensor of the Xs-axis direction is disposed on theposition of Ys=0, the acceleration sensor of the Ys-axis direction isdisposed on the position of Xs=0, and the acceleration sensor of theZs-axis direction is disposed on the Zs axis, in order to simplify thecalculation of the operational calculating section.

Furthermore, the respective acceleration sensors are arranged on thepositions near the Zs axis, in order to reduce the amount of thecalculation and thereby shorten the calculating time.

Furthermore, the pen-shaped input apparatus comprises a high-pass filterfor transmitting the high-frequency component of the signals from thethree acceleration sensors and the three gyroscopes generated by theaction of the friction between the pen's tip end and the handwritingsurface, judges the start of handwriting on the basis of any of thesignals from the three acceleration sensors and the three gyroscopespassing through the high-pass filters which contain the high-frequencycomponent, e.g. 100 Hz, for the first time, and judges the end ofhandwriting on the basis of the disappearance, after some predeterminedthreshold time period of all high frequency component signals from thethree acceleration sensors and the three gyroscopes. In such manner, theprehandwriting condition as well as the handwriting start and thehandwriting end can be detected with a simple construction.

Furthermore, the pen-shaped input apparatus comprises a handwritingorbit extracting section and a fitting section. The handwriting orbitextracting section extracts the orbit of the pen's tip end from thestart of handwriting to the end thereof in accordance with the movementdirection and the movement distance of the pen's tip end calculated bythe movement amount calculating section. The fitting section transfersthe image of the orbit of the pen's tip end extracted by the handwritingorbit extracting section onto the handwriting surface, and therebycompensates the influence due to the inclination of the handwritingsurface.

And further, the movement amount calculating section calculates themovement distances in the Xg direction and the Yg direction, and thehandwriting orbit extracting section extracts the orbit of the pen's tipend from the start of handwriting to the end thereof in accordance withthe movement distances in the Xg direction and the Yg direction of thepen's tip end calculated by the movement amount calculating section. Insuch manner, the influence due to the inclination of the handwritingsurface can be accommodated with a simple construction.

The pen-shaped input apparatus of the second embodiment is capable ofinputting characters, symbols, and figures, etc. into a computerapparatus or the like. The pen-shaped input apparatus of the secondembodiment detects the accelerations in the Xs-axis direction, theYs-axis direction, and the Zs-axis direction of the pen shaft coordinatesystem having the pen shaft as the Zs axis, and thereby the movementdirection and the movement distance of the pen's tip end on the basis ofthe acceleration thus detected in the Xs-axis direction, the Ys-axisdirection, and the Zs-axis direction. The -error due to the mountingposition of the acceleration sensors and other errors due to theinclination of the apparatus are included in the accelerations detectedby the acceleration sensors.

FIG. 10 is a structure view showing the second embodiment according tothe present invention.

As shown in FIG. 10, the above pen-shaped input apparatus 101 comprisesacceleration sensors 102 a, 102 b, and 102 c, gyroscopes 103 a, 103 b,and 103 c, an operational calculating section 104, a storage section105, and a power supply section 106.

The acceleration sensors 102 a, 102 b, and 102 c are respectivelyarranged near the Zs axis in the directions of the Xs axis, the Ys axis,and the Zs axis, on the assumption that the pen shaft 107 is the Zsaxis, respectively detect the accelerations in the directions of the Xsaxis, the Ys axis, and the Zs axis, and respectively output the signalsshowing the detected accelerations. A piezoelectric voltage system,electrostatic capacitance system, or piezoelectric resistance system maybe used as the acceleration sensors 102 a, 102 b, and 102 c. Thegyroscopes 103 a, 103 b, and 103 c respectively detect the rotationalangular velocities around the Xs axis, the Ys axis, and the Zs axis andrespectively output the signals showing the detected rotational angularvelocities.

As in the first embodiment, the coordinate system of pen shaft 107 asthe Zs axis is called the pen shaft coordinate system (Xg, Yg, Zg), andthe two axes perpendicular to the Zs axis and to each other arerespectively called the Xs axis and the Ys axis. And further, thecoordinate system of the axis extending in the gravity accelerationdirection as the Zg axis is called the gravity coordinate system (Xg,Yg, Zg), and the two axes perpendicular to the Zg axis and to each otherare respectively called the Xg axis and the Yg axis. Furthermore, theangles formed between the Xs axis and the Ys axis, between the Zs axisand the Xg axis, and between the Yg axis and the Zg axis arerespectively called φ, θ, and ψ.

As shown in FIG. 11, the operational calculating section 104 for thesecond embodiment comprises A/D converters 141 a-141 f, low-pass filters142 a-142 f, high-pass filters 143 a-143 f, a static (state) judgmentsection 144, an initial inclination angle calculating section 145, aninclination angle variation calculating section 146, a handwritinginclination angle calculating section 147, an acceleration compensatingsection 148, a coordinates conversion calculating section 149, a gravityacceleration removing section 150, a movement amount calculating section151, a handwriting orbit extracting section 152, and a fitting section153.

The A/D converters 141 a-141 f convert, respectively, the analog signalsfrom the acceleration sensors 102 a, 102 b, and 102 c and the gyroscopes103 a, 103 b, and 103 c to digital signals. The low-pass filters 142a-142 f intercept the high-frequency component of the signals from theacceleration sensors 102 a, 102 b, and 102 c and from the gyroscopes 103a, 103 b, and 103 c caused by the frictional force between the pen's tipend 108 and the surface to be handwritten. The high-pass filters 143a-143 f extract the high-frequency component of the signals from theacceleration sensors 102 a, 102 b, and 102 c and from the gyroscopes 103a, 103 b, and 103 c, for instance, at frequencies above the neighborhoodof 10 Hz caused by the frictional force.

The static state judgment section 144 judges the beginning of ahandwriting operation when any one of the signals from the threeacceleration sensors 102 a, 102 b, and 102 c and the three gyroscopes103 a, 103 b, and 103 c respectively pass through the high-pass filters143 a-143 f which contain the high-frequency component, for the firsttime, and judges the end of a handwriting operation when there are nolonger any signals from the three acceleration sensors 102 a, 102 b, and102 c and the three gyroscopes 103 a, 103 b, and 103 c which passthrough the same high-pass filters 143 a-143 f after some predeterminedthreshold time period.

For instance, the pen's tip end 108 is constructed with the core of thepencil, and the waveform of the acceleration signal when handwriting onthe paper occurs is shown in FIG. 12. As shown in FIG. 12, thehandwriting acceleration component due to pencil movement appears in thepart of comparatively low frequency equal to or lower than the centerfrequency 10 Hz, while the component caused by the friction between thepen's tip end 108 and the writing surface appears in the part ofcomparatively high frequency, e.g. 100 Hz, equal to or higher than 10Hz. In such situation, the high-pass filters 143 a-143 f respectivelyextract the components of the frequency above 10 Hz, and the staticstate judgment section 144 compares the signals thus extracted by thehigh-pass filters 143 a-143 f with a previously determined thresholdvalue, and thereby judges whether the pen-shaped input apparatusperforms a handwriting operation.

Hereupon, depending on the direction of the handwriting, since adifference appears in the components caused by the pen's tip end 108 andthe surface to be handwritten respectively detected by the accelerationsensors 102 a, 102 b, and 102 c and the gyroscopes 103 a, 103 b, and 103c, the static state judgment section 144 judges the start of handwritingon the basis of the presence of any one of the signals containing thehigh-frequency component for the first time, and the same judges the endof handwriting when the last of any one of the signals containing thehigh-frequency component is no longer present for a threshold period.

The initial inclination angle calculating section 145 calculates theinitial values φ₀θ₀, and ψ₀ of the inclination angle in the gravitycoordinate system (Xg, Yg, Zg) of the pen shaft 107 on the basis of theaccelerations in the pen shaft coordinate system (Xs, Ys, Zs) detectedby the three acceleration sensors 102 a, 102 b, and 102 c in a state ofnon-handwriting.

The inclination angle variation calculating section 146 calculates thevariations Δφ, Δθ, and Δψ of the inclination angles in the gravitycoordinate system (Xg, Yg, Zg) of the pen shaft 107 on the basis of therotational angular velocities detected by the three gyroscopes 103 a,103 b, and 103 c in a state of handwriting.

The handwriting inclination angle calculating section 147 obtains theinclination angles φ, θ, and ψ in the gravity coordinate system (Xg, Yg,Zg) of the pen shaft 108 during the handwriting on the basis of theinitial values φ₀, θ₀, and ψ₀ of the inclination angles in the gravitycoordinate system (Xg, Yg, Zg) of the pen shaft 107 calculated by theinitial inclination angle calculating section 145 and the variations Δφ,Δθ, and Δψ of the inclination angles in the gravity coordinate system(Xg, Yg, Zg) of the pen shaft 107 calculated by the inclination anglevariation calculating section 141.

The acceleration compensating section 148 compensates the accelerationson the mounting position of the three acceleration sensors 102 a, 102 b,and 102 c in the pen shaft coordinate system (Xs, Ys, Zs) to theaccelerations of the pen's tip end 108 on the basis of the mountingposition of the three acceleration sensors 102 a, 102 b, and 102 c, therotational angular velocities detected by the three gyroscopes 103 a,103 b, and 103 c, the inclination angle variation of the pen shaft 107calculated by the inclination angle variation calculating section 146,and the inclination angle of the pen shaft 107 during handwritingcalculated by the handwriting inclination angle calculating section 147.

The coordinates conversion calculating section 149 converts theacceleration in the pen shaft coordinate system (Xs, Ys, Zs) compensatedby the acceleration compensating section 148 to the acceleration in thegravity coordinate system (Xg, Yg, Zg) on the basis of the inclinationangles φ, θ, and ψ in the gravity coordinates system (Xg, Yg, Zg) of thepen shaft 107 during handwriting detected by the handwriting incinationangle calculating section 147.

The gravity acceleration removing section 150 removes the gravityacceleration component from the acceleration converted by thecoordinates conversion calculating section 149.

The movement amount calculating section 151 calculates the movementdirection and the movement distance of the pen's tip end 108 on thebasis of the acceleration, from which the gravity acceleration removingsection 150 removes the gravity acceleration component.

The handwriting orbit extracting section 152 extracts the orbit of thepen's tip end 108 from the start of handwriting to the end ofhandwriting in accordance with the movement direction and the movementdistance of the pen's tip end 108 calculated by the movement amountsection 151.

The fitting section 153 image-transfers the orbit of the pen's tip end108 extracted by the handwriting orbit extracting section 152 and storedin the storage section 105 to the surface to be handwritten.

Now, the operational calculation of the calculating section 104 isdescribed hereinafter. Coordinate converting equations for convertingthe gravity coordinate system (Xg, Yg, Zg) to the pen shaft coordinatesystem (Xs, Ys, Zs) are as follows: $\begin{matrix}{{( \begin{matrix}{Xs} \\{Ys} \\{Zs}\end{matrix}\quad ) = {{E( {\varphi,\theta,\psi} )}\quad \begin{pmatrix}{Xg} \\{Yg} \\{Zg}\end{pmatrix}}}{{E( {\varphi,\theta,\psi} )} = \begin{pmatrix}a_{11} & a_{12} & a_{13} \\a_{21} & a_{22} & a_{23} \\a_{31} & a_{32} & a_{33}\end{pmatrix}}{a_{11} = {\cos \quad \theta \quad \cos \quad \psi}}{a_{21} = {{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\cos \quad \varphi \quad \sin \quad \psi}}}{a_{31} = {{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\sin \quad \varphi \quad \sin \quad \psi}}}{a_{12} = {\cos \quad \theta \quad \sin \quad \psi}}{a_{22} = {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}}}{a_{32} = {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} - {\sin \quad \varphi \quad \cos \quad \psi}}}{a_{13} = {{- \sin}\quad \theta}}{a_{23} = {\sin \quad \varphi \quad \cos \quad \theta}}{a_{33} = {\cos \quad \varphi \quad \cos \quad \theta}}} & (13)\end{matrix}$

If the above equation (equation 13) is converted by the coordinatesconversion formula from the pen shaft coordinate system (Xs, Ys, Zs) tothe gravity coordinate system (Xg, Yg, Zg), the following equation(equation 14) can be obtained. $\begin{matrix}{{( \begin{matrix}{Xg} \\{Yg} \\{Zg}\end{matrix}\quad ) = {{E^{- 1}( {\varphi,\theta,\psi} )}\quad \begin{pmatrix}{Xs} \\{Ys} \\{Zs}\end{pmatrix}}}{{E^{- 1}( {\varphi,\theta,\psi} )} = \begin{pmatrix}a_{11} & a_{21} & a_{31} \\a_{12} & a_{22} & a_{32} \\a_{13} & a_{23} & a_{33}\end{pmatrix}}} & (14)\end{matrix}$

Here, the coordinates (Xga, Yga, Zga) in the gravity coordinate system(Xg, Yg, Zg) at a point A shown in FIG. 13 can be expressed by thefollowing equation (equation 15) including the coordinates (Xgo, Ygo,Zgo) in the gravity coordinates system (Xg, Yg, Zg) of the pen's tip end108, the coordinates (Lx, Ly, Lz) in the pen shaft coordinates system(Xs, Ys, Zs) at the point A,. and the inclination angles φ,θ, and ψ.$\begin{matrix}{( \begin{matrix}{Xga} \\{Yga} \\{Zga}\end{matrix}\quad ) = {( \begin{matrix}{Xgo} \\{Ygo} \\{Zgo}\end{matrix}\quad )\quad + {{E^{- 1}( {\varphi,\theta,\psi} )}\quad \begin{pmatrix}{Lx} \\{Ly} \\{Lz}\end{pmatrix}}}} & (15)\end{matrix}$

The above equation (equation 15) differentiated two times by timerepresents the accelerations (Axg, Ayg, Azg) in the gravity coordinatessystem (Xg, Yg, Zg) of the point A (Xga, Yga, Zga). Here, since theinclination angles φ, θ, and ψ are also functions of the time, thefollowing equations (equation 16) can be obtained. $\begin{matrix}{{( \begin{matrix}{Axga} \\{Ayga} \\{Azga}\end{matrix}\quad ) = {( \begin{matrix}{\overset{¨}{X}{ga}} \\{\overset{¨}{Y}{ga}} \\{\overset{¨}{Z}{ga}}\end{matrix}\quad ) = {( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) + {\frac{^{2}}{t^{2}}( E^{- 1} )\quad \begin{pmatrix}{Lx} \\{Ly} \\{Lz}\end{pmatrix}}}}}{where}\begin{matrix}{{\overset{¨}{X}{ga}} = {\frac{^{2}}{t^{2}}({Xga})}} & {{\overset{¨}{X}{go}} = {\frac{^{2}}{t^{2}}({Xgo})}} \\{{\overset{¨}{Y}{ga}} = {\frac{^{2}}{t^{2}}({Yga})}} & {{\overset{¨}{Y}{go}} = {\frac{^{2}}{t^{2}}({Ygo})}} \\{{\overset{¨}{Z}{ga}} = {\frac{^{2}}{t^{2}}({Zga})}} & {{\overset{¨}{Z}{go}} = {\frac{^{2}}{t^{2}}({Zgo})}}\end{matrix}} & (16)\end{matrix}$

Furthermore, the force of gravity is exerted in the Zg-axis direction inthe gravity coordinate system (Xg, Yg, Zg) regardless of the movement ofthe pen's tip end 108, and then, if the gravity acceleration g is addedto the above equation (equation 16), the following equation (equation17) can be obtained. $\begin{matrix}{( \begin{matrix}{Axga} \\{Ayga} \\{Azga}\end{matrix}\quad ) = {( \begin{matrix}{\overset{¨}{X}{ga}} \\{\overset{¨}{Y}{ga}} \\{\overset{¨}{Z}{ga}}\end{matrix}\quad ) = {( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) + {\frac{^{2}}{t^{2}}( E^{- 1} )\quad \begin{pmatrix}{Lx} \\{Ly} \\{Lz}\end{pmatrix}} - \begin{pmatrix}0 \\0 \\g\end{pmatrix}}}} & (17)\end{matrix}$

Assuming that the acceleration sensors 102 a, 102 b, and 102 c arearranged at the point A, the accelerations (Axsa, Aysa, Azsa) detectedby the acceleration sensors 102 a, 102 b, and 102 c can be expressed bythe following equations (equations 18a, 18b). $\begin{matrix}{ \begin{matrix}{Axsa} \\{Aysa} \\{Azga}\end{matrix}\quad ) = {( \begin{matrix}{\overset{¨}{X}{sa}} \\{\overset{¨}{Y}{sa}} \\{\overset{¨}{Z}{sa}}\end{matrix}\quad ) = {{E( {\varphi,\theta,\psi} )}\quad ( \begin{matrix}{\overset{¨}{X}{ga}} \\{\overset{¨}{Y}{ga}} \\{\overset{¨}{Z}{ga}}\end{matrix}\quad )}}} & \text{(18a)} \\{\quad {= {{E( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad )} + {E\frac{^{2}}{t^{2}}( E^{- 1} )\quad \begin{pmatrix}{Lx} \\{Ly} \\{Lz}\end{pmatrix}} - {E\quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}}}\quad} & \text{(18b)} \\\begin{matrix}{{\overset{¨}{X}{sa}} = {\frac{^{2}}{t^{2}}({Xsa})}} \\{{\overset{¨}{Y}{sa}} = {\frac{^{2}}{t^{2}}({Ysa})}} \\{{\overset{¨}{Z}{sa}} = {\frac{^{2}}{t^{2}}({Zsa})}}\end{matrix} & \quad\end{matrix}$

Next, assuming that the acceleration sensors 102 a, 102 b, and 102 c arearranged respectively at the points B, C, and D, and the coordinates inthe pen shaft coordinate system (Xs, Ys, Zs) at the points B, C, and Dare, respectively, B (Lxx, Lxy, Lxz), C (Lyx, Lyy, Lyz), and D (Lzx,Lzy, Lzz), the second term of the equations 18 is replaced by thefollowing equation (equation 19). $\begin{matrix}{{{E\frac{^{2}}{t^{2}}( E^{- 1} )} = \begin{pmatrix}f_{11} & f_{12} & f_{13} \\f_{21} & f_{22} & f_{23} \\f_{31} & f_{32} & f_{33}\end{pmatrix}}{where}{f_{11} = {{- \overset{.}{\theta}} - {{\overset{.}{\psi}}^{2}\cos^{2}\theta}}}\begin{matrix}{f_{12} = \quad {{2\overset{.}{\varphi}\quad \overset{.}{\theta}\quad \cos \quad \varphi} + {2\overset{.}{\varphi}\overset{.}{\psi}\quad \sin \quad \varphi \quad \cos \quad \theta} - \frac{{\overset{.}{\psi}}^{2}\sin \quad \varphi \quad \sin \quad ( {2\theta} )}{2} +}} \\{\quad {{\overset{¨}{\theta}\sin \quad \varphi} - {\overset{¨}{\psi}\cos \quad \varphi \quad \cos \quad \theta}}}\end{matrix}\begin{matrix}{f_{13} = \quad {{{- 2}\overset{.}{\varphi}\quad \overset{.}{\theta}\quad \sin \quad \varphi} + {2\overset{.}{\varphi}\overset{.}{\psi}\quad \cos \quad \varphi \quad \cos \quad \theta} - \frac{{\overset{.}{\psi}}^{2}\cos \quad \varphi \quad \sin \quad ( {2\theta} )}{2} +}} \\{\quad {{\overset{¨}{\theta}\cos \quad \varphi} - {\overset{¨}{\psi}\sin \quad \varphi \quad \cos \quad \theta}}}\end{matrix}{f_{21} = {{{- 2}\overset{.}{\varphi}\quad \overset{.}{\psi}\quad \cos \quad \varphi \quad \sin \quad \theta} - \frac{{\overset{.}{\psi}}^{2}\sin \quad \varphi \quad \sin \quad ( {2\theta} )}{2} - {\overset{¨}{\theta}\quad \sin \quad \varphi} + {\overset{¨}{\psi}\quad \cos \quad \varphi \quad \cos \quad \theta}}}\begin{matrix}{f_{22} = \quad {{- {\overset{.}{\varphi}}^{2}} + {2\overset{.}{\varphi}\overset{.}{\psi}\sin \quad \theta} - {{\overset{.}{\theta}}^{2}\sin^{2}\varphi} + {\overset{.}{\theta}\overset{.}{\psi}\sin \quad ( {2\varphi} )\quad \cos \quad \theta} +}} \\{\quad {{\overset{.}{\psi}}^{2}( {{\sin^{2}\varphi \quad \cos^{2}\theta} - 1} )}}\end{matrix}\begin{matrix}{f_{23} = \quad {{- \frac{{\overset{.}{\theta}}^{2}\quad \sin \quad ( {2\varphi} )}{2}} + {2\overset{.}{\theta}\quad \overset{.}{\psi}\quad \cos^{2}\varphi \quad \cos \quad \theta} + \frac{{\overset{.}{\psi}}^{2}\sin \quad ( {2\varphi} )\quad \sin^{2}\theta}{2} -}} \\{\quad {\overset{¨}{\varphi} + {\overset{¨}{\psi}\sin \quad \theta}}}\end{matrix}{f_{31} = {{2\overset{.}{\theta}\overset{.}{\psi}\sin \quad \varphi \quad \sin \quad \theta} - \frac{{\overset{.}{\psi}}^{2}\cos \quad \varphi \quad \sin \quad ( {2\theta} )}{2} - {\overset{¨}{\theta}\cos \quad \varphi} - {\overset{¨}{\psi}\sin \quad \varphi \quad \cos \quad \theta}}}\begin{matrix}{f_{32} = \quad {{- \frac{{\overset{.}{\theta}}^{2}\quad \sin \quad ( {2\varphi} )}{2}} - {2\overset{.}{\theta}\quad \overset{.}{\psi}\quad \sin^{2}\varphi \quad \cos \quad \theta} + \frac{{\overset{.}{\psi}}^{2}\sin \quad ( {2\varphi} )\quad \cos^{2}\theta}{2} +}} \\{\quad {\overset{¨}{\varphi} - {\overset{¨}{\psi}\sin \quad \theta}}}\end{matrix}\begin{matrix}{f_{33} = \quad {{- {\overset{.}{\varphi}}^{2}} - {{\overset{.}{\theta}}^{2}\cos^{2}\varphi} + {2\overset{.}{\varphi}\overset{.}{\psi}\sin \quad \theta} - {\overset{.}{\theta}\overset{.}{\psi}\sin \quad ( {2\varphi} )\quad \cos \quad \theta} +}} \\{\quad {{\overset{.}{\psi}}^{2}( {{\cos^{2}\varphi \quad \cos^{2}\theta} - 1} )}}\end{matrix}\begin{matrix}{\overset{.}{\varphi} = {\frac{}{t}\varphi}} & {\overset{¨}{\varphi} = {\frac{^{2}}{t^{2}}\varphi}} \\{\overset{.}{\theta} = {\frac{}{t}\theta}} & {\overset{¨}{\theta} = {\frac{^{2}}{t^{2}}\theta}} \\{\overset{.}{\psi} = {\frac{}{t}\psi}} & {\overset{¨}{\psi} = {\frac{^{2}}{t^{2}}\psi}}\end{matrix}} & (19)\end{matrix}$

From the above equation (equation 19), the accelerations (Axs, Ays, Azs)detected by the respective acceleration sensors 102 a, 102 b, and 102 ccan be expressed by the following equation (equation 20).$\begin{matrix}\begin{matrix}{ \begin{matrix}{Axs} \\{Ays} \\{Azs}\end{matrix}\quad ) = {\begin{pmatrix}{Axsa} \\{Aysb} \\{Azsc}\end{pmatrix} = ( \begin{matrix}{\overset{¨}{X}{sa}} \\{\overset{¨}{Y}{sb}} \\{\overset{¨}{Z}{sc}}\end{matrix}\quad )}} \\{= {{E\quad ( \begin{matrix}{\overset{¨}{X}{so}} \\{\overset{¨}{Y}{so}} \\{\overset{¨}{Z}{so}}\end{matrix}\quad )} + \begin{pmatrix}{{f_{11}{Lxx}} + {f_{12}{Lxy}} + {f_{13}{Lxz}}} \\{{f_{21}{Lyx}} + {f_{22}{Lyy}} + {f_{23}{Lyz}}} \\{{f_{31}{Lzx}} + {f_{32}{Lzy}} + {f_{33}{Lzz}}}\end{pmatrix} - {E\quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}}}\end{matrix} & (20)\end{matrix}$

The acceleration compensating section 148 performs the operationalcalculation of the second term of the above equations (equation 20) andcompensates the accelerations (Axs, Ays, Azs) detected by the respectiveacceleration sensors 102 a, 102 b, and 102 c. And further, after thecoordinates conversion calculating section 149 performs the coordinatesconversion of the compensated acceleration, the gravity accelerationremoving section 150 removes the gravity acceleration component, andthereby the acceleration (Axgo, Aygo, Azgo) of the pen's tip end 108 canbe obtained.

Here, the accelerations (Axgo, Aygo, Azgo) in the gravity coordinatessystem (Xg, Yg, Zg) of the pen's tip end 108 can be expressed by thefollowing equation (equation 21) obtained by differentiating two timesthe movement distances (Xgo, Ygo, Zgo) in the gravity coordinate system(Xg, Yg, Zg). $\begin{matrix}{\begin{matrix}{\begin{pmatrix}{Axgo} \\{Aygo} \\{Azgo}\end{pmatrix} = ( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad )} \\{= {{E^{- 1}\{ {( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad ) - \begin{pmatrix}{{f_{11}{Lxx}} + {f_{12}{Lxy}} + {f_{13}{Lxz}}} \\{{f_{21}{Lyx}} + {f_{22}{Lyy}} + {f_{23}{Lyz}}} \\{{f_{31}{Lzx}} + {f_{32}{Lzy}} + {f_{33}{Lzz}}}\end{pmatrix}} \}} + \quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}}\end{matrix}{where}\begin{matrix}{{\overset{¨}{X}s} = {\frac{^{2}}{t^{2}}({Xs})}} & {{\overset{¨}{Y}s} = {\frac{^{2}}{t^{2}}({Ys})}} & {{\overset{¨}{Z}s} = {\frac{^{2}}{t^{2}}({Zs})}}\end{matrix}} & (21)\end{matrix}$

The movement amount calculating section 151 integrates two times thethus calculated accelerations (Axgo, Aygo, Azgo) in the gravitycoordinate system (Xg, Yg, Zg) of the pen's tip end 108 and therebyobtains the orbit of the pen's tip end 108.

Next, the initial values (φ₀, θ₀, ψ₀) of the inclination angle areexplained. Since only the gravity accelerations are exerted in a staticstate, the accelerations (Axs, Ays, Azs) in the pen shaft coordinatesystem (Xs, Ys, Zs) can be obtained with the equation of differentiatingtwo times the movement distances (Xs, Ys, Zs). The equation (equation22) is as follows: $\begin{matrix}{( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad ) = {{{- E}\quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}} = \begin{pmatrix}{g\quad \sin \quad {\theta 0}} \\{{- g}\quad \cos \quad {\theta 0}\quad {{sin\varphi}0}} \\{{- g}\quad \cos \quad {\theta 0}\quad \cos \quad {\varphi 0}}\end{pmatrix}}} & (22)\end{matrix}$

As mentioned above, in a static state, the accelerations (Axs, Ays, Azs)in the pen shaft coordinate system (Xs, Ys, Zs) detected by theacceleration sensors 102 a, 102 b, and 102 c is not affected dependingon the mounting position of the acceleration sensor. Here, since threeequations can be established for the two unknown figures φ₀ and θ₀, thegravity acceleration g can be also treated as the unknown figure.Furthermore, it is possible also to calculate the value of the gravityacceleration g and judge whether the calculation is good or bad on thebasis of the variation of the value calculated adding the function ofmonitoring. Furthermore, the relationship between the rotational angularvelocities (P, Q, R) of the angle axis of the pen shaft coordinatessystem (Xs, Ys, Zs) and the variation of the inclined angular velocities(φ, θ, ψ) can be expressed by the following equations (equations 23a,23b, 23c):

{dot over (φ)}=P+Qsinφtanθ+Rcosφtanθ  (23a

{dot over (θ)}=Qcosφ−Rsinψ  (23b

{dot over (ψ)}=Qsinφsecθ+Rcosφsecθ  (23c

Here, it is possible also to express the accelerations (Axgo, Aygo,Azgo) of the pen's tip end 108 capable of being obtained with theequation of differentiating the movement distances (Xgo, Ygo, Zgo) inthe gravity coordinates system (Xg, Yg, Zg) of the pen's tip end 108 bythe following equations (equation 24a, 24b). $\begin{matrix}{( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) = {{E^{- 1}\quad ( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad )} + \begin{pmatrix}{{e_{11}{Lxx}} + {e_{12}{Lxy}} + {e_{13}{Lxz}}} \\{{e_{21}{Lyx}} + {e_{22}{Lyy}} + {e_{23}{Lyz}}} \\{{e_{31}{Lzx}} + {e_{32}{Lzy}} + {e_{33}{Lzz}}}\end{pmatrix} + \quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}} & \text{(24a)} \\{{\frac{^{2}}{t^{2}}( E^{- 1} )} = \begin{pmatrix}e_{11} & e_{12} & e_{13} \\e_{21} & e_{22} & e_{23} \\e_{31} & e_{32} & e_{33}\end{pmatrix}} & \text{(24b)}\end{matrix}$

The operation of the pen-shaped input apparatus 101 is explainedhereinafter referring to the flow chart in FIG. 14.

The acceleration sensors 102 a, 102 b, and 102 c respectively detect theaccelerations in the Xs direction, the Ys direction, and the Zsdirection. The high-pass filters 143 a-143 f extract the high-frequencycomponent above the neighborhood of 10 Hz of the signals from theacceleration sensors 102 a, 102 b, and 102 c and the gyroscopes 103 a,103 b, and 103 c respectively inputted through the A/D converters 141a-141 f. The static state judgment section 144 outputs the signalshowing whether the handwriting is being performed on the basis of thesignals from the high-pass filters 143 a-143 f. In such manner, sincethe high-frequency signals are caused by the frictional force betweenthe pen's tip end 108 and the writing surface, it is easy to preciselydetect when handwriting has started by detecting these high-frequencysignals and when it has ended by detecting the absence of the highfrequency signals for some threshold time period.

The initial inclination angle calculating section 145 inputs the signalsfrom the acceleration sensor 102 a of the Xs axis, the accelerationsensor 102 b of the Ys axis, and the acceleration sensor 102 c when thesection 145 does not receive any signal showing that a “handwriting”operation is in effect and calculates the initial values φ₀, θ₀, and ψ₀of the inclination angle in the gravity coordinate system of the penshaft 107 (Step S101).

When the inclination angle variation calculating section 146 receivesthe signal showing a “handwriting” operation from the static statejudgment section 144 (Step S102), the section 146 calculates thevariations Δφ,Δθ, and Δψ of the inclination angle in the gravitycoordinates system (Xg, Yg, Zg) of the pen shaft 107 on the basis of therotational angular velocity detected by the three gyroscopes 103 a, 103b, and 103 c (Step S103).

The handwriting inclination angle calculating section 147, as mentionedabove, obtains the inclination angles (φ,θ, ψ) of the handwriting penshaft 107 (Step S104) on the basis of the initial values φ₀, θ₀, and ψ₀of the inclination angle of the pen shaft 107 calculated by the initialinclination angle calculating section 145 and the variations of theinclination angles (φ,θ,ψ) of the pen shaft 108 calculated by theinclination angle variation calculating section 145.

The acceleration compensating section 148 compensates the accelerations(Axso, Ayso, Azso) of the pen shaft (Xs, Ys, Zs) detected by the threeacceleration sensors 102 a, 102 b, and 102 c to the accelerations (Axso,Ayso, Azso) at the pen's tip end 108 (Step S105) on the basis of thecoordinates (Lxx, Lxy, Lxz), (Lyx, Lyy, Lyz), and (Lzx, Lzy, Lzz) of themounting position of the three acceleration sensors 102 a, 102 b, and102 c, the variations of the inclination angles (φ,θ,ψ) of the pen shaft7 calculated by the inclination angle variation calculating section 146,and the inclination angles (φ,θ,ψ) of the handwriting pen shaft 107calculated by the handwriting inclination angle calculating section 147.

The coordinates conversion calculating section 149 converts theaccelerations (Axso, Ayso, and Azso) compensated by the accelerationcompensating section 148 to the accelerations (Axgo, Aygo, Azgo) in thegravity coordinate system (Xg, Yg, Zg) (Step S106) on the basis of thehandwriting inclination angles (φ,θ,ψ) detected by the handwritinginclination angle calculating section 147.

In such manner, since the mounting position of the acceleration sensors102 a, 102 b, and 102 c and the influence due to the inclination arecompensated, it is possible to detect precisely the acceleration in thegravity coordinate system (Xg, Yg, Zg) at the pen's tip end 108.

The gravity acceleration removing section 150 removes the gravityacceleration component from the accelerations (Axgo, Aygo, Azgo)converted by the coordinates conversion calculating section 149 (StepS107).

The movement amount calculating section 151 calculates the movementdirection and the movement distance of the pen's tip end 108 (Step S108)by integrating twice the accelerations (Axgo, Aygo, Azgo) at the pen'stip end 108 after a gravity acceleration component is removed by thegravity acceleration removing section 150.

In such manner, since the integration is performed after compensatingthe accelerations (Axs, Ays, Azs) detected by the acceleration sensors102 a, 102 b, and 102 c, it may be possible to reduce the error causedby the result of the integration.

The handwriting orbit extracting section 152 extracts the orbit of thepen's tip end 108 from the start of the handwriting to the end thereoffrom the movement direction and the movement distance of the pen's tipend 108 calculated by the movement amount calculating section 151 andmemorizes the extracted orbit in the storage section 105 (Steps S109,S110).

The fitting section 153 specifies the surface to be handwritten from theorbit of the pen's tip end 108 extracted by the handwriting orbitextracting section 152, for instance, by use of the minimum squaringmethod, and transfers the image of the orbit of the pen's tip end 108onto the surface to be handwritten (Step S111).

For instance, if the three-dimensional data (Xi, Yi, Zi) of thehandwriting orbit as shown in FIG. 15a are put into the equation;aX+bY+cZ+d=0, an equation; aXi+bYi+cZi+d=δi can be obtained, and thesurface to be handwritten (a, b, c, d) is specified so as to minimizethe squaring sum of the error Σ(δi)². Here, as shown in FIG. 15b, theerror di becomes the shortest distance between the coordinates (Xi, Yi,Zi) and the surface to be handwritten. In such manner, it is possible toinput precisely the movement distance on the handwriting surface of thepen's tip end 108 even when the handwriting surface is inclined, bytransferring the orbit of the pen's tip end 108 onto the handwritingsurface.

The pen-shaped input apparatus 101 repeats the above-mentionedoperations (Steps S103-S111) until the static state judgment section 144does not detect the high-frequency component from the accelerationsensors 102 a, 102 b, and 102 c or the gyroscopes 103 a, 103 b, and 103c (Step S112)after a threshold period of time, and thereby preciselyinputs characters and figures, etc. into a computer or the like.

Moreover, in the above second embodiment, although the coordinates ofthe acceleration sensors 102 a, 102 b, and 102 c are (Lxx, Lxy, Lxz), incase that the Xs-axis direction acceleration sensor 102 a is disposed onthe position of Ys=0, Ys-axis direction acceleration sensor 102 b isdisposed on the position of Xs=0, and the Zs-axis direction accelerationsensor 102 c is disposed on the Zs axis, the coordinates of theacceleration sensors 102 a, 102 b, and 102 c become (Lxx, 0, Lxz), (0,Lyy, Lyz), and (0, 0, Lzz).

The accelerations (Axgo, Aygo, Azgo) which can be obtained bydifferentiating twice the movement distances (Xgo, Ygo, Zgo) in thegravity coordinate system (Xg, Yg, Zg) of the pen's tip end 108 can beexpressed by the following equation (equation 25), and it may bepossible to reduce the compensation calculating amount of theacceleration detected by the acceleration sensors 102 a, 102 b, and 102c. $\begin{matrix}{( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) = {{E^{- 1}\{ {( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad ) - \begin{pmatrix}{{f_{11}{Lxx}} + {f_{13}{Lxz}}} \\{{f_{22}{Lyy}} + {f_{23}{Lyz}}} \\{f_{33}{Lzz}}\end{pmatrix}} \}} + \quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}} & (25)\end{matrix}$

Here, when the Xs-axis direction acceleration sensor 102 a is disposedon the position of Xs=0, the Ys-axis direction acceleration sensor 102 bis disposed on the position of Ys=0, and the Zs-axis directionacceleration sensor 102 c is disposed on the Zs axis, the coordinates ofthe acceleration sensors 102 a, 102 b, and 102 c become (0, Lxy, Lxz),(Lyx, 0, Lyz), and (0, 0, Lzz), and the accelerations (Axgo, Aygo, Azgo)which can be obtained with the equation of differentiating twice themovement distances (Xg, Yg, Zg) in the gravity coordinate system (Xg,Yg, Zg) of the pen's tip end 108 can be expressed by the followingequation (equation 26): $\begin{matrix}{( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) = {{E^{- 1}\{ {( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad ) - \begin{pmatrix}{{f_{12}{Lxy}} + {f_{13}{Lxz}}} \\{{f_{21}{Lyx}} + {f_{23}{Lyz}}} \\{f_{33}{Lzz}}\end{pmatrix}} \}} + \quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}} & (26)\end{matrix}$

And further, if the respective sensors 102 a, 102 b, and 102 c arearranged on the Zs axis, (all of) Lxx, Lxy, Lyx, Lyy, Lzx, and Lzybecome 0 (zero). Therefore, the coordinates of the acceleration sensors102 a, 102 b, and 102 c turn out to be (0, 0, Lxz), (0, 0, Lyz), and (0,0, Lzz), and the accelerations (Axgo, Aygo, Azgo) which can be obtainedwith the equation of differentiating twice the movement distance (Xgo,Ygo, Zgo) in the gravity coordinates system (Xg, Yg, Zg) of the pen'stip end 108 can be expressed by the following equation (equation 27),and further it may be possible to reduce the compensation calculatingamount of the acceleration. $\begin{matrix}{( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) = {{E^{- 1}\{ {( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad ) - \begin{pmatrix}{f_{13}{Lxz}} \\{f_{23}{Lyz}} \\{f_{33}{Lzz}}\end{pmatrix}} \}} + \quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}} & (27)\end{matrix}$

And further, as shown in FIGS. 16 through 18, since the specifiedelement of the compensation term has a large acceleration component, itmay be allowed to calculate the accelerations (Axgo, Aygo, Azgo) in thegravity coordinate system (Xg, Yg, Zg) of the pen's tip end 108 with thefollowing equation (equation 28) by use of only the specified element.Thereby, the time of the calculation can be further shortened.

For instance, Lxx (d²θ/dt²) cosφ is employed as the compensation elementof the Xs-axis direction acceleration, Lyz {(d²ψ/dt²) sin(φ−θ)} isemployed as the compensation element of the Ys-axis directionacceleration, and −Lzz {(dφ/dt)²+(dθ/dt)² cos²φ} is employed as thecompensation element of the Zs-axis direction acceleration.$\begin{matrix}{( \begin{matrix}{\overset{¨}{X}{go}} \\{\overset{¨}{Y}{go}} \\{\overset{¨}{Z}{go}}\end{matrix}\quad ) = {{E^{- 1}\{ {( \begin{matrix}{\overset{¨}{X}s} \\{\overset{¨}{Y}s} \\{\overset{¨}{Z}s}\end{matrix}\quad ) - \begin{pmatrix}{{Lxz}\quad \overset{¨}{\theta}\quad \cos \quad \varphi} \\{{Lyz}\quad ( {{\overset{¨}{\psi}\sin \quad \theta} - \overset{¨}{\varphi}} )} \\{{- {Lzz}}\quad ( {\overset{.}{\varphi} + {{\overset{.}{\theta}}^{2}\cos^{2}\varphi}} )}\end{pmatrix}} \}} + \quad \begin{pmatrix}0 \\0 \\g\end{pmatrix}}} & (28)\end{matrix}$

Furthermore, in this second embodiment, the fitting section 153 makesshortest the distance between the coordinates (Xi, Yi, Zi) and transfersthe image of the orbit of the pen's tip end 108 onto the handwritingsurface. However, for instance as shown in FIG. 19, it may be allowedalso to make shortest the distance between the coordinates (Xi, Yi, Zi)and the handwriting surface in the Zg-axis direction.

For instance, the equation showing the handwriting surface is(a₁X+(b₁)Y+Z+d₁=0, and the three-dimensional data (Xi, Yi, Zi) of thehandwriting orbit are put into (substituted for) the above equation, andthereby an equation; (a₁)×(Xi)+(b₁)×(Yi)+(Zi)+(d₁)=σi can be obtained.And then, the handwriting surface (a₁, b₁, d₁) is specified so as tomake minimum the squaring sum Σ(σi)² of the above error.

In such manner, the calculating time can be shortened by decreasing theparameter by one. On this occasion, although an error occurs when thehandwriting surface is vertical, in the using status of the ordinarypen-shaped input apparatus 101, the handwriting surface is scarcely madevertical.

Furthermore, it may be allowed that the movement amount calculatingsection 151 calculates only the movement distances in the Xg directionand the Yg direction of the pen's tip end on the basis of theacceleration converted by the coordinates conversion calculating section149, the handwriting orbit extracting section 102 extracts the orbit ofthe pen's tip end from the start of handwriting to the end thereof inaccordance with the movement distances in the Xg direction and the Ygdirection of the pen's tip end 108 calculated by the movement amountcalculating section 151, and thereby the influence due to theinclination of the handwriting surface is compensated with a simplestructure. On this occasion, it is not necessary to provide the gravityacceleration removing section 150 and the fitting section 153.Furthermore, the calculation time expensed in those sections can beshortened, and further the general calculation time can be largelyshortened because it is not necessary to perform the movement amountcalculating process in the Zg direction by the movement amountcalculating section 151.

As is apparent from the foregoing description, in the second embodimentaccording to the present invention, since the inclination angle of thehandwriting pen shaft is calculated on the basis of the initial value ofthe inclination angle of the pen shaft and the inclination anglevariation of the pen shaft, the accelerations detected by the threeacceleration sensors are compensated to the acceleration at the pen'stip end on the basis of the mounting positions of the three accelerationsensors, the inclination angle variation of the pen shaft, and theinclination angle of the handwriting pen shaft, the compensatedacceleration in the pen shaft coordinate system is converted to theacceleration in the gravity coordinate system on the basis of theinclination angle of the handwriting pen shaft, and the movementdirection and the movement distance of the pen's tip end are calculatedon the basis of the converted acceleration, it may be possible toprecisely detect the movement direction and the movement distance of thepen's tip end moving on the handwriting surface with a small-sizedapparatus.

Furthermore, since the acceleration sensor of the Xs-axis direction isdisposed on the position of Ys=0, the acceleration sensor of the Ys-axisdirection is disposed on the position of Xs=0, and the accelerationsensor of the Zs-axis direction is disposed on the Zs axis, thecalculating process can be simplified and the calculating time can beshortened.

Furthermore, since the respective sensors are arranged on the placesnear the Zs axis, the calculating amount can be further reduced andthereby the operating time can be shortened.

Furthermore, since the signals from the acceleration sensors and thegyroscopes judge the beginning of handwriting and the end thereof on thebasis of the high-frequency component caused by the friction between thepen's tip end and the handwriting surface, the beginning of handwritingand the end thereof can be precisely detected with a simpleconstruction.

Furthermore, since the orbit of the pen's tip end from the start ofhandwriting to the end thereof is extracted and the extracted orbitimage of the pen's tip end is transferred onto the handwriting surface,the influence due to the inclination of the handwriting surface can becompensated.

Furthermore, since the movement distances in the Xg direction and the Ygdirection of the pen's tip end from the start of handwriting to the endthereof are extracted, the influence due to the inclination of thehandwriting surface can be compensated for a short period of time andwith a simple calculating construction.

E. Detailed Description of the Third Embodiment

The pen-shaped input apparatus relating to the third embodiment of thepresent invention comprises three acceleration sensors, threegyroscopes, and an operational calculating section. The threeacceleration sensors respectively detect the accelerations in theXs-axis direction, Ys-axis direction, and Zs-axis direction of thepen-shaft coordinates system (Xs, Ys, Zs) having a pen shaft as Zs axis.The three gyroscopes respectively detect the rotational angularvelocities around the Xs axis, the Ys axis, and the Zs axis. Theoperational calculating section comprises a handwriting detectingsection, an initial rotational angle calculating section, a rotationalangle variation calculating section, a handwriting rotational anglecalculating section, a coordinates conversion calculating section, and amovement amount calculating section.

The handwriting detecting section detects whether the pen's tip end isbrought into contact with the handwriting surface and thereby detectswhether the pen-shaped input apparatus is in the handwriting state or inthe non-handwriting state.

Furthermore, the initial rotational angle calculating section calculatesthe initial value of the rotational angle of the pen shaft in thegravity coordinates system (Xg, Yg, Zg) having a shaft extending in thegravity acceleration direction as the Zg axis, on the basis of theacceleration detected by the three acceleration sensors when thehandwriting detecting section detects the non-handwriting state.

The rotational angle variation calculating section calculates thevariation of the rotational angle in the gravity coordinate system (Xg,Yg, Zg) of the pen shaft, on the basis of the rotational angularvelocity detected by the three gyroscopes, when the handwriting sectiondetects the handwriting state.

The handwriting rotational angular velocity calculating sectioncalculates the rotational angle in the gravity coordinate system (Xg,Yg, Zg)of the handwriting pen shaft, on the basis of the initial valueof the rotational angle calculated by the initial rotational anglecalculating section and the rotational angle variation calculated by therotational angle variation calculating section.

The coordinate conversion calculating section converts the accelerationin the pen shaft coordinate system (Xs, Ys, Zs) detected by theacceleration sensors to the acceleration in the gravity coordinatesystem (Xg, Yg, Zg), on the basis of the rotational angle in the gravitycoordinate system (Xg, Yg, Zg) of the handwriting calculated by thehandwriting rotational angle calculating section.

The movement amount calculating section calculates the movementdirection and the movement distance at the pen's tip end, on the basisof the acceleration converted by the coordinates conversion calculatingsection.

And further, the handwriting detecting section detects whether the pen'stip end is brought into contact with the handwriting surface, on thebasis of the high-frequency component of the signals from the threeacceleration sensors.

And further, the handwriting detecting section includes a pressuresensor for detecting the stress applied to the pen's tip end from thehandwriting surface, and detects whether the pen's tip end contacts thesurface by detecting the stress from the handwriting surface by use ofthe pressure sensor.

Furthermore, the initial rotational angle calculating section performsseveral times the process of calculating the rotational angle of the penshaft in the gravity coordinate system (Xg, Yg, Zg), on the basis of theacceleration detected by the three acceleration sensors, when thehandwriting detecting section, and the initial rotational anglecalculating section obtains the initial value of the rotational angle ofthe pen shaft when the pen's tip end comes into contact with thehandwriting surface, by averaging the result of the calculation.Thereby, the initial value of the rotation of the pen shaft can becalculated precisely.

Furthermore, the initial rotational angle calculating section comprisesan acceleration variation amount detecting section, a variation amountcomparing section, and an alarming section. The acceleration variationamount detecting section detects the variation amount of theaccelerations detected by the three acceleration sensors. The variationamount comparing section compares the variation amount of theacceleration detected by the acceleration variation amount detectingsection with a predetermined threshold value. The alarming sectionoutputs an alarm signal when the variation amount of the accelerationdetected by the acceleration variation amount detecting section exceedsthe predetermined threshold value, and notifies the probability of theoccurrence of the error detection to the user.

Furthermore, the above-mentioned initial rotational angle calculatingsection performs several times the process of calculating the rotationalangle of the pen shaft in the gravity coordinate system (Xg, Yg, Zg), onthe basis of the accelerations detected by the three accelerationsensors in a state of non-handwriting state excluding theacceleration(s), the variation of which is judged by the variationamount comparing section to exceed the predetermined threshold value,averages the result of the calculation, and obtains the initial value ofthe rotational angle of the pen shaft when the pen's tip end comes intocontact with the handwriting surface by averaging the result of thecalculation. In such manner, the occurrence of the detection error dueto an abnormal value can be prevented.

The pen-shaped input apparatus of the third embodiment of the presentinvention can also input characters, symbols, and figures, etc. into acomputer or the like. The pen-shaped input apparatus of the thirdembodiment detects the accelerations in the X-axis direction, the Y-axisdirection, and the Z-axis direction of the pen shaft coordinate systemhaving the pen shaft in a state of non-handwriting state as the Z axis,and obtains the initial value of the rotational angle of the pen shaftin the gravity coordinate system at the time of bringing the pen's tipend into contact with the handwriting surface having a shaft extendingin the gravity acceleration direction in accordance with the detectedacceleration. And further, the pen-shaped input apparatus detects therotational angular velocities around the X axis, the Y axis, and Z axisin the handwriting pen shaft coordinate system, and calculates thevariation of the rotational angle in the gravity coordinate system ofthe pen shaft. Thereby, the rotational angle in the gravity coordinatesystem of the handwriting pen shaft is obtained, the acceleration in thepen shaft coordinates system is converted to the acceleration in thegravity coordinates system, and the movement direction and the movementdistance can be detected precisely.

The handwriting detecting section includes, for instance, high-passfilters and OR gates. The high-pass filters respectively extract thehigh-frequency component of the signals from the respective accelerationsensors. The OR gates take logical sum of the high-frequency componentof the signals from the respective acceleration sensors transmittedthrough the respective high-pass filters, and detects the contactingstate of the pen's tip end with the handwriting surface in case that anyone or more of the accelerations detected by the respective accelerationsensors contain(s) the high-frequency component. This means that thehigh-frequency component of the signals from the acceleration sensors issensed to determine when there is a writing based on the signalgenerated by the action of the friction between the pen's tip end andthe handwriting surface.

FIG. 20 is a structural view showing a pen-shaped input apparatus of thethird embodiment according to the present invention. As shown in FIG.20, the pen-shaped input apparatus 201 comprises acceleration sensors202 a, 202 b, and 202 c, gyroscopes 203 a, 203 b, and 203 c, anoperational calculating section 204, a storage section 205, acommunicating section 206, and a power supply section 207.

The acceleration sensors 202 a, 202 b, and 202 c are respectivelydisposed in the Xs-axis direction, the Ys-axis direction, and theZs-axis direction in case that the pen shaft 208 is the Zs shaft. The Xsaxis and the Ys axis intersect perpendicularly to the Zs axis and toeach other, and detect the acceleration in the X-axis, Y-axis, andZ-axis directions at the pen's tip end 209. A piezoelectric sensor, anelectrostatic capacitance sensor, or a piezo-resistance sensor can beused as the acceleration sensors 202 a, 202 b, and 202 c.

The gyroscopes 203 a, 203 b, and 203 c respectively detect therotational angular velocity around the Xs axis, the Ys axis, and the Zsaxis.

The coordinate system having a pen shaft as the Zs axis is called a “penshaft coordinate system”, and the two axes intersecting perpendicularlyto the pen shaft 208 and to each other are explained as the Xs axis andthe Ys axis. And further, the coordinate system having an axis extendingin the gravity acceleration direction as Zg axis is called a “gravitycoordinate system”, and the two axes intersecting perpendicularly to Zgaxis and to each other are called, respectively, Xg axis and Yg axis.The angles formed between the Xs axis and the Ys axis, between the Zsaxis and the Xg axis, and between the Yg axis and the Zg axis are,respectively, θ,φ and ψ.

Furthermore, in the following description, “inputting” signifies aseries of operations of inputting characters, symbols and figures, etc.,and includes both the case where the pen's tip end is brought intodirect contact with the handwriting surface and the case where the pen'stip end is separated from the handwriting surface. On the other hand,“handwriting” signifies only the former case.

As shown in FIG. 21, the operational calculating section 204 comprisesA/D converters 241 a-241 f, low-pass filters 242 a—242 f, a handwritingdetecting section 243, an initial rotational angle calculating section244, a rotational angle variation calculating section 245, a handwritingrotational angle calculating section 246, a coordinates conversioncalculating section 247, and a movement amount calculating section 248.The A/D converters 241 a-241 f respectively convert the analog signalsfrom the acceleration sensors 202 a, 202 b, and 202 c and the gyroscopes203 a, 203 b, and 203 c to digital signals. The low-pass filters 242a-242 f intercept the high-frequency component of the signals from theacceleration sensors 202 a, 202 b, and 202 c and the gyroscopes 203 a,203 b, and 203 c all generated by the action of the frictional forcebetween the pen's tip end 209 and the handwriting surface.

The handwriting detecting section 243 comprises, for instance, as shownin FIG. 22, high-pass filters 431, 432, and 433 and an OR gate 434. Thehigh-pass filters 431, 432, and 433 extract the high-frequency componentof the signals from the acceleration sensors 202 a, 202 b, and 202 cgenerated by the action of the friction, for instance, frequencies above10 Hz. Here, the high-frequency component of the signals from theacceleration sensors 202 a, 202 b, and 202 c is generated by the actionof the friction between the pen's tip end 209 and the handwritingsurface, and exceeds the frequency near 10 Hz. Therefore, the signalcontaining this high-frequency component signifies the state of“handwriting”.

The OR gate 434 takes the logical sum of the high-frequency component ofthe signals from the respective acceleration sensors 202 a, 202 b, and202 c transmitted through the high-pass filters 431, 432, and 433, andoutputs the signal showing the state of “handwriting or not”. Here,since the OR gate 434 takes the logical sum of the high-frequencycomponent of the signals from the acceleration sensors 202 a, 202 b, and202 c, the “High” signal showing the state of “handwriting” is outputtedin case that any one or more of the signals from the accelerationsensors 202 a, 202 b, and 202 c contain(s) the high-frequency component.

The initial rotational angle calculating section 244 calculates theinitial values θ₀, φ₀, and ψ₀ of the rotational angle in the gravitycoordinates system of the pen shaft 209 at the beginning of handwriting,on the basis of the acceleration in the pen shaft coordinates systemdetected by the three acceleration sensors 202 a, 202 b, and 202 c in astate of non-handwriting.

The rotational angle variation calculating section 245 calculates therotational angle variations Δθ, Δφ, and Δψ in the gravity coordinatesystem of the pen shaft 209, on the basis of the rotational angularvelocity detected by the three gyroscopes 203 a, 203 b, and 203 c in astate of handwriting.

The handwriting rotational angle calculating section 246 obtains therotational angles θ, φ, and ψ in the gravity coordinates system of thehandwriting pen shaft 209, on the basis of the initial values θ₀, φ₀,and ψ₀ of the rotational angle in the gravity coordinates system of thepen shaft 209 calculated by the initial rotational angle calculatingsection 204 and the variations Δθ, Δφ, and Δψ of the rotational angle inthe gravity coordinate system of the pen shaft 209 calculated by therotational angle variation calculating section 245.

The coordinates conversion calculating section 247 converts theacceleration in the pen shaft coordinates system detected by theacceleration sensors 202 a, 202 b, and 202 c to the acceleration in thegravity coordinate system, on the basis of the rotational angles θ, φ,and ψ in the gravity coordinate system of the handwriting pen shaft 209detected by the handwriting rotational angle calculating section 246.

The movement amount calculating section 248 calculates the movementdirection and the movement distance of the pen's tip end 209, on thebasis of the acceleration in the gravity coordinate system converted bythe coordinates conversion calculating section 247, and stores the abovecalculated values in the storage section 205.

The operation of the pen-shaped input apparatus 201 having theabove-mentioned structure is described hereinafter referring to the flowchart shown in FIG. 23.

The acceleration sensors 202 a, 202 b, and 202 c respectively detect theaccelerations in the Xs direction, the Ys direction, and the Zsdirection in accordance with the movement of the pen's tip end 209.

The handwriting detecting section 243 extracts the high-frequencycomponent of the signals from the acceleration sensors 202 a, 202 b, and202 c inputted through the A/D converters 241 a-241 f, for instance,exceeding the frequency near 10 Hz, and outputs the signal showing thestate of “handwriting” or “non-handwriting.”

Hereupon, in case that the high-frequency component above the frequencynear 10 Hz is contained in one or more of the signals from theacceleration sensors 202 a, 202 b, and 202 c, the state is“handwriting”. Namely, the high-frequency component of the signals fromthe acceleration sensors 202 a, 202 b, and 202 c is generated by theaction of the frictional force between the pen's tip end 209 and thehandwriting surface, and neighbors the frequency near 10 Hz. In suchmanner, the apparatus detects the high-frequency signal generated by theaction of the frictional force between the pen's tip end 209 and thehandwriting surface, and judges the state of “handwriting” or“non-handwriting.”

When the handwriting detecting section 243 detects the state ofnon-handwriting, the initial rotational angle calculating section 244performs the operation of inputting the signals from the accelerationsensor 202 a for the Xs axis, the acceleration sensor 202 b for the Ysaxis, and the acceleration sensor 202 c for the Zs axis, and calculatesthe initial values θ₀, φ₀, and ψ₀ of the rotational angle in the gravitycoordinate system of the pen shaft 208 at the time of starting theoperation of handwriting (Step S201).

Next, a method of calculating the rotational angle is describedhereinafter. The conversion from the gravity coordinate system to thepen shaft coordinate system can be performed by use of the followingequation (equation 29). $\begin{matrix}{{( \begin{matrix}{Xs} \\{Ys} \\{Zs}\end{matrix}\quad ) = {\begin{pmatrix}{as1} & {as2} & {as3} \\{bs1} & {bs2} & {bs3} \\{cs1} & {cs2} & {cs3}\end{pmatrix}\quad ( \begin{matrix}{Xg} \\{Yg} \\{Zg}\end{matrix}\quad )}}{{as1} = {\cos \quad \theta \quad \cos \quad \psi}}{{as2} = {\cos \quad \theta \quad \sin \quad \psi}}{{as3} = {{- \sin}\quad \theta}}{{bs1} = {{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\cos \quad \varphi \quad \sin \quad \psi}}}{{bs2} = {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}}}{{bs3} = {\sin \quad \varphi \quad \cos \quad \theta}}{{cs1} = {{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\sin \quad \varphi \quad \sin \quad \psi}}}{{cs2} = {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} - {\sin \quad \varphi \quad \cos \quad \psi}}}{{cs3} = {\cos \quad \varphi \quad \cos \quad \theta}}} & (29)\end{matrix}$

If the above equations are transformed to the converting equations fromthe pen shaft coordinate system to the gravity coordinate system, thefollowing equation (equation 30) can be obtained. $\begin{matrix}{{{( \begin{matrix}{Xg} \\{Yg} \\{Zg}\end{matrix}\quad ) = {\begin{pmatrix}{ag1} & {ag2} & {ag3} \\{bg1} & {bg2} & {bg3} \\{cg1} & {cg2} & {cg3}\end{pmatrix}\quad ( \begin{matrix}{Xs} \\{Ys} \\{Zs}\end{matrix}\quad )}}{{ag1} = {\cos \quad \theta \quad \cos \quad \psi}}{{ag2} = {{\sin \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} - {\cos \quad \varphi \quad \sin \quad \psi}}}{{ag3} = {{\cos \quad \varphi \quad \sin \quad \theta \quad \cos \quad \psi} + {\sin \quad \varphi \quad \sin \quad \psi}}}{{bg1} = {\cos \quad \theta \quad \sin \quad \psi}}{bg2} = {{\sin \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} + {\cos \quad \varphi \quad \cos \quad \psi}}}{{bg3} = {{\cos \quad \varphi \quad \sin \quad \theta \quad \sin \quad \psi} - {\sin \quad \varphi \quad \cos \quad \psi}}}{{cg1} = {{- \sin}\quad \theta}}{{cg2} = {\sin \quad \varphi \quad \cos \quad \theta}}{{cg3} = {\cos \quad \varphi \quad \cos \quad \theta}}} & (30)\end{matrix}$

The above equations are approximated by the first-order approximationformula, and thereby converting equations of the acceleration vectorscan be obtained. Moreover, assume that Axs, Ays, and Azs arerespectively the acceleration vectors detected by the accelerationsensors 202 a, 202 b, and 202 c in the pen shaft coordinate system, andAxg, Ayg, and Azg are respectively the acceleration vectors detected bythe acceleration sensors 202 a, 202 b, and 202 c in the gravitycoordinate system, then the following equations (equations 31a, 31b)apply. $\begin{matrix}{( \begin{matrix}{Axs} \\{Ays} \\{Azs}\end{matrix}\quad ) = {\begin{pmatrix}{as1} & {as2} & {as3} \\{bs1} & {bs2} & {bs3} \\{cs1} & {cs2} & {cs3}\end{pmatrix}\quad ( \begin{matrix}{Axg} \\{Ayg} \\{Azg}\end{matrix}\quad )}} & \text{(31a)} \\{( \begin{matrix}{Axg} \\{Ayg} \\{Azg}\end{matrix}\quad ) = {\begin{pmatrix}{ag1} & {ag2} & {ag3} \\{bg1} & {bg2} & {bg3} \\{cg1} & {cg2} & {cg3}\end{pmatrix}\quad ( \begin{matrix}{Axs} \\{Ays} \\{Azs}\end{matrix}\quad )}} & \text{(31b)}\end{matrix}$

If the acceleration vectors Axs, Ays, and Azs and the rotational anglesθ, φ, and ψ are substituted for the above-mentioned first-orderapproximation formula, the acceleration vectors Axg, Ayg, and Azg on thehandwriting surface can be obtained.

On the other hand, the acceleration in a static state can be expressedby the following equation (equation 32). $\begin{matrix}{( \begin{matrix}{Axg} \\{Ayg} \\{Azg}\end{matrix}\quad ) = \begin{pmatrix}0 \\0 \\{- g}\end{pmatrix}} & (32)\end{matrix}$

If the acceleration in this static state is substituted for theafore-mentioned coordinates conversion formula, the rotational angles θ₀and φ₀ in the gravity coordinate system of the pen shaft 208 in thestatic state at the time of starting the handwriting can be obtained asmentioned below. $\begin{matrix}{( \begin{matrix}{Axs} \\{Ays} \\{Azs}\end{matrix}\quad ) = \begin{pmatrix}{(g)\quad \sin \quad ( {\theta 0} )} \\{{- (g)}\cos \quad ( {\theta 0} )\quad {\sin ( {\varphi 0} )}} \\{{- (g)}\cos \quad ( {\theta 0} )\quad \cos \quad ( {\varphi 0} )}\end{pmatrix}} & (33)\end{matrix}$

Here, since the rotational angle ψ₀ is the angle formed between the Zsaxis and the Zg axis, the Xg axis can be taken in the inclinationdirection of the Xs axis by resetting the rotational angle ψ₀ to zero.Or otherwise, it may be allowed also to optionally decide the rotationalangle ψ₀ in accordance with the method of putting the pen-shaped inputapparatus 201 on the handwriting surface and the method of gripping thepen-shaped input apparatus 201.

And further, since three equations can be established for the rotationalangles θ₀ and φ₀ in the static state, those angles can be treated alsoas the unknown figures for the gravity acceleration g, and the absolutevalues of the rotational angles θ₀ and φ₀ in the static state withoutdefining the value of the gravity acceleration g. Furthermore, the valueof g is calculated, and whether the calculation is good or bad is judgedin accordance with the variation of the value of this calculated gravityacceleration g. For instance, in case that the calculated value changeslargely, it may be allowed also to issue an alarm.

When the handwriting detecting section 243 detects the state ofhandwriting (Step S202), the rotational angle calculating section 245calculates the variations Δθ, Δφ, and Δψ of the rotational angles in thegravity coordinate system of the pen shaft 208, on the basis of therotational angular velocities calculated by the three gyroscopes 203 a,203 b, and 203 c (Step S203). Assuming that the rotational angularvelocity of the respective axes Xs, Ys, and Zs of the pen shaftcoordinates are P, Q, and R, the relationship between the rotationalangular velocities P, Q, and R and the rotational angle variations Δφ,Δθ, and Δψ can be obtained by the following equations (equations 34a,34b, 34c).

Δφ=P+Qsinφtanθ+Rcosφtan θ  (34a

Δθ=Qcos φ−Rsinφ  (34b

Δφ=Qsinφsecθ+Rcosφsecθ  (34c

The handwriting rotation angle calculating section 246 obtains therotational angles θ, φ, and ψ of the handwriting pen shaft (Step S204),on the basis of the initial values θ₀, φ₀, and ψ₀ of the rotationalangle of the pen shaft 208 calculated by the initial angle calculatingsection 244 and the variations Δθ, Δφ, and Δψ of the rotational angle ofthe pen shaft 208 calculated by the rotational angle variationcalculating section 245. The coordinates conversion calculating section247 respectively converts the accelerations Axs, Ays, and Azs in the penshaft coordinate system detected by the acceleration sensors 202 a, 202b, and 202 c to the accelerations Axg, Ayg, and Azg in the gravitycoordinate system (Step S205), on the basis of the handwritingrotational angle detected by the handwriting rotational anglecalculating section 246. Moreover, in order to convert the accelerationsAxs, Ays, and Azs in the pen shaft coordinate system to theaccelerations Axg, Ayg, and Azg in the gravity coordinate system, theconversion formula already explained before is used.

The movement amount calculating section 248 calculates the movementdirection and the movement distance of the pen's tip end 209 (StepS206), on the basis of the acceleration of the pen's tip end 209converted by the coordinates conversion calculating section 247 (StepS206), and stores the calculated values in the storage section 205 (StepS207). The pen-shaped input apparatus 201 repeats the above-mentionedoperations (Steps S203-S207) until detecting the input ending signal,and inputs the figure, etc. (Step S208). In such manner, it may bepossible to precisely input the figure, etc., by compensating theinfluence due to the rotation angle in the gravity coordinate system ofthe pen-shaped input apparatus. One can also generate the input endingsignal on the basis of the acceleration variation. One may also employthe signal from the enable switch, etc.

Next, taking the case of handwriting in practice into consideration, forinstance, the acceleration Axs in the Xs-axis direction is as shown inFIG. 24. Here, the part encircled with a dotted line in FIG. 24 showsthe acceleration in an initial state of stopping. If the portionencircled with the dotted line is enlarged, the enlarged portion turnsout to be, for instance, as shown in FIG. 25. Namely, the accelerationvaries in practice even in the state that the pen's tip end 209 does notmove, as shown in FIG. 25.

This variation of the acceleration is derived from, for instance, thevibration of the hand gripping the pen-shaped input apparatus 201.Consequently, there occur some occasions on which the initial rotationalangle is calculated in a state of containing the influence due to thevibration of the hand, etc. For this reason, it may be allowed also thatthe apparatus is constructed as shown in FIG. 26 for example, and theinitial rotational angle calculating section 244 a performs severaltimes the calculation of the rotational angle of the pen shaft 208 inthe gravity coordinate system (Xg, Yg, and Zg) on the basis of theaccelerations detected by the three acceleration sensors 202 a, 202 b,and 202 c in a state of non-handwriting and obtains the initial value ofthe rotational angle of the pen shaft 208 at the time of the beginningof handwriting by averaging the result of the calculation.

The initial rotational angle calculating section 244 a is provided with,for instance, a sample rotational angle calculating section 441, asampling frequency counting section 442, and an average valuecalculating section 443, as shown in FIG. 27.

The sample rotational angle calculating section 441 inputs the signalsfrom the acceleration sensor 202 a for the Xs axis, the accelerationsensor 202 b for the Ys axis, and the acceleration sensor 202 c for theZs axis when the handwriting detecting section 443 does not input thesignal showing the state of handwriting, calculates the rotationalangles θ_(n), φ_(n), and ψ_(n) in the gravity coordinate system of thepen shaft 208 in a state of non-handwriting, and stores the calculatedvalues in the storage section 205.

The sampling frequency counting section 442 counts the frequency ofcalculating the rotational angles θ_(n), φ_(n), and ψ_(n) by use of thesample rotational angle calculating section 441.

The average value calculating section 443 reads out the rotationalangles θ_(n) , φ_(n), and ψ_(n) calculated by the sample rotationalangle calculating section 441 and stored by the storage section 205,when the counting value of the sampling frequency counting section 442becomes, for instance, three or more, and calculates the average valuethereof, and thereby calculates the initial value of the rotationalangle of the pen shaft at the time of starting the handwriting.

The operation of the pen-shaped input apparatus 201 a is describedhereinafter, referring to the flow chart as shown in FIG. 28.

The initial rotational angle calculating section 244 a inputs thesignals from the acceleration sensor 202 a for the Xs axis, theacceleration sensor 202 b for the Ys axis, and the acceleration sensor202 c for the Zs axis when the handwriting detecting section 243 detectsthe state of non-handwriting, calculates the rotational angles θ_(a),φ_(a), and ψ_(a) in the gravity coordinate system of the pen shaft 208at the time of starting the handwriting in the state of non-handwriting,and stores the calculated values in the storage section 205 (Step S211).

The initial rotational angle calculating section 244 a repeats thesampling process, for instance, three or more times and thereby obtainsthe rotational angles θ_(a)−θ_(n), φ_(a)−φ_(n), and ψ_(a)−ψ_(n) (StepS212). Thereafter, the same calculates the average values of theobtained rotational angles θ_(a)−θ_(n), φ_(a)−φ_(n), and ψ_(a)−ψ_(n) andobtains the initial values θ₀, φ₀, and ψ₀ of the rotational angle of thepen shaft 208 (Step S213).

In such manner, since the initial values θ₀, φ₀, and ψ₀ of therotational angle of the pen shaft 208 by use of the average value, evenin case that one of the plural sampling values, for instance, isaffected by the vibration of the hand, etc., the exerted influencethereof can be averaged and made small.

When the rotational angle calculating section 245 has already detectedthe state of the handwriting by the handwriting detecting section 243(Step S214), the rotational angle calculating section 245 calculates thevariations Δθ, Δφ, and Δψ of the rotational angle in the gravitycoordinate system of the pen shaft 208, on the basis of the rotationalangular velocity detected by the three gyroscopes 203 a, 203 b, and 203c (Step S215).

The handwriting rotational angle calculating section 246 obtains therotational angles θ, φ, and ψ of the handwriting pen shaft (Step S216),on the basis of the initial values θ₀, φ₀, and ψ₀ of the rotationalangle of the pen shaft 208 calculated by the initial rotational anglecalculating section 244 a and the variations Δθ, Δφ, and Δψ of therotational angle of the pen shaft 208 calculated by the rotational anglevariation calculating section 245.

The coordinates conversion calculating section 247 converts theaccelerations Axs, Ays, and Azs of the pen shaft coordinate systemdetected by the acceleration sensors 202 a, 202 b, and 202 c to theaccelerations Axg, Ayg, and Azg in the gravity coordinate system (StepS217), on the basis of the handwriting rotational angle detected by thehandwriting rotational angle calculating section 246.

The movement amount calculating section 248 calculates the movementdirection and the movement distance of the pen's tip end 209 (StepS218), on the basis of the acceleration of the pen's tip end 209converted by the coordinates conversion calculating section 247, andstores the calculated values in the storage section 205 (Step S219). Thepen-shaped input apparatus 201 repeats the above-mentioned operations(Steps S215-S219) until the input ending signal is detected, and inputsthe figure, etc. (Step S220). In such manner, the initial values θ₀, φ₀,and ψ₀ of the rotational angle of the pen shaft 208 is calculatedprecisely, and thereby the figure or the like can be inputted furtherprecisely.

Furthermore, it may be allowed also that, in case that the variationvalue of the acceleration detected by the acceleration sensors 202 a,202 b, and 202 c exceeds the previously determined threshold value, theacceleration is removed from the accelerations to be sampled and/or thealarm is issued. The example of the construction to implement thisfeature is shown in FIG. 29.

The acceleration variation amount detecting section 249 respectivelydetects the variation amounts (ΔAxs)/(Δt), (ΔAys)/(Δt), and (ΔAzs)/(Δt)of the acceleration Axs in the Xs-axis acceleration, the accelerationAys in the Ys-axis acceleration, and the acceleration Azs in the Zs-axisacceleration. Here, “t” shows the time.

The variation amount comparing section 250 comprises, for example, athreshold storing section 501, an Xs-axis comparator, a Ys-axiscomparator, a Zs-axis comparator, and an OR gate, as shown in FIG. 30.The threshold storing section 501 stores the previously determinedthreshold value. The Xs-axis comparator, the Ys-axis comparator, and theZs-axis comparator compare the respective variation values of theaccelerations Axs, Ays, and Azs detected by the acceleration variationamount detecting section 249 with the respective threshold values storedin the threshold storing section 501. The OR gate 505 may be allowed toissue the alarm signal through the alarming section 251, in case thateither one or more of the variation amounts of the accelerations Axs,Ays, and Azs exceed(s) the previously determined threshold value(s). Forinstance,. as shown by the dotted line in FIG. 31, the threshold valuesare set at +1.5 (m/sec³) and at −1.5 (m/sec³), and the alarm signal isissued through the alarming section 251 in case that the variationamount (ΔA)/(Δt) of the acceleration A becomes+1.5 (m/sec³) or more orin case that the same becomes −1.5 (m/sec³) or less. Thereby, the usercan know the occurrence of the input error. The above threshold valuemay be stored in the storage section 205 or it may be stored in the hostapparatus. Furthermore, the alarm output from the alarming section 251is transmitted to the host apparatus through the communicating section207 and causes the host apparatus to display the error. Or, a lamp isprovided on the pen-shaped input apparatus 201 c and the error displayis performed by lighting the lamp. Alternatively, the error occurrenceis notified by use of a buzzer.

Furthermore, when the variation amounts of the accelerations Axs, Ays,and Azs are large, the variation amount comparing section 250 removesthe acceleration(s) of large variation amount from the data to becalculated (for the movement amount) and continues the input processing.For instance, in case that the variation amount (ΔA)/(Δt) becomes +1.5(m/sec³) or more or in case that the same becomes −1.5 (m/sec³) or less,the variation amount comparing section 250 notifies the above matter tothe initial rotational angle calculating section 244 b.

During the time period when the initial rotational angle calculatingsection 244 b receives the notification of too large accelerationvariation from the variation amount comparing section 250, the section244 b reads off (does not read) the acceleration detected by theacceleration sensors 202 a, 202 b, and 202 c and removes theacceleration at the time of the abnormal input occurrence from the datato be calculated (for the initial rotational angle). Consequently, themovement direction and the movement distance of the pen's tip end 209can be calculated further precisely.

Moreover, although the handwriting detecting section 243 detects thestate of handwriting or not on the basis of the accelerations Axs, Ays,and Azs detected by the acceleration sensors 202 a, 202 b, and 202 c inthe above-mentioned embodiment, a pressure sensor 211 may be used fordetecting the pressure applied to the pen's tip end 209 from thehandwriting surface 210 as shown in FIG. 32, or a signal for showing thestate of handwriting or not from the enable switch, etc. is input.

And further, although the acceleration detected by the accelerationsensors 202 a, 202 b, and 202 c is read off during the time period whenthe initial rotational angle calculating section receives thenotification of too large an acceleration variation from the variationamount comparing section 250 in the above embodiment, the accelerationsfrom the low-pass filters 242 a-242 c may be input to the initialrotational angle calculating section 244 a through the accelerationabnormal value removing section, and the acceleration abnormal valueremoving section transmits the acceleration in the range determined bythe (two) threshold values and outputs the transmitted acceleration tothe initial rotational angle calculating section 244 a.

Moreover, the sampling data of the static state rotational anglecalculated by the initial rotational angle calculated by the initialrotational angle calculating section 244 b and stored in the storagesection 205 may be erased.

Furthermore, an element such as LED, etc. may be employed for displayingthe time period when the initial rotational angle calculating 244 iscalculating the initial rotational angle.

Finally, as an additional explanation, the output of the accelerationsensor at the time of performing the handwriting in practice isdescribed hereinafter in more detail.

FIG. 33a shows the acceleration waveform in the X direction in the caseof handwriting the mark “{dot over (A)}õ” by use of the pen-shaped inputapparatus. The area encircled with the dotted line represents theacceleration data at the initial static time. Noticing this area, anenlarged waveform is shown in FIG. 33b.

Practically, as shown in FIG. 33b, a variation can be found in the areaassumed as the static state. It seems that the above variation iscaused, for instance, by the vibration of the hand gripping thepen-shaped input apparatus, or the like. There is a probability that,when the acceleration at an optional one point is taken, the inclinationamount in the gravity coordinate system of the pen shaft is obtained onthe assumption of the static state, the obtained value becomes theamount including the acceleration caused by the vibration of the hand,etc. Therefore, it causes an error, or undesirably creates a factor forworsening the reproducing property.

In order to solve such defect, the average value of more than at least acertain value (for instance, three) as shown by the dotted line in FIG.33b is used. Since the frequency of the handwriting acceleration (theacceleration caused by the pen's movement at the time of handwriting) isseveral Hz as shown in FIG. 33a and FIG. 33b, for instance, thefrequency of the acceleration variation caused by the vibration of thehand, etc. is almost 10 Hz, it is difficult to separate such unfavorablecomponent by means of filtering or the like. For this reason, thisproblem can be solved easily and very efficiently by use of theaveraging process. In such method and structure as mentioned above, itis possible to obtain the inclination value in the gravity coordinatesystem of the pen shaft without being affected by the vibration of thehand or the like.

As is apparent from the foregoing description, since this thirdembodiment calculates the initial value of the rotational angle of thepen shaft at the beginning of handwriting in the gravity coordinatesystem, on the basis of the acceleration in the pen shaft coordinatesystem when the signal showing the non-handwriting state is input, theinitial value of the rotational angle of the pen shaft can be obtainedprecisely and the operation thereof can be done simply.

Furthermore, since the variation of the rotational angle in the penshaft gravity coordinate system is calculated on the basis of therotational angular velocity of the pen shaft at the time of inputtingthe signal showing the state of handwriting, the rotational angle in thegravity coordinate system of the handwriting pen shaft on the basis ofthe initial value of the rotational angle and the variation of therotational angle, the acceleration in the pen shaft coordinate system ofthe pen's tip end is converted to the acceleration in the gravitycoordinate system on the basis of the calculated rotational angle in thegravity coordinate system of the handwriting pen shaft, and the movementdirection and the movement distance of the pen's tip end on the basis ofthe converted acceleration, characters, symbols, figures, etc. can beinput precisely with a small-sized apparatus.

And further, since whether the pen's tip end is brought into contactwith the handwriting surface is judged on the basis of thehigh-frequency component of the signals from the three accelerationsensors, the beginning of handwriting can be judged precisely.

And further, since the stress applied to the pen's tip end from thehandwriting surface is detected and thereby whether the pen's tip end isbrought into contact with the handwriting surface is judged, the startof handwriting can be judged even more precisely.

Furthermore, since the calculating treatment of the rotational angle ofthe pen shaft in the gravity coordinate system is performed severaltimes, and the initial value of the rotational angle of the pen shaft isobtained by averaging the result of the above calculation, the initialvalue of the rotational angle of the pen shaft can be calculated evenmore precisely.

Furthermore, since the variation value of the acceleration in the penshaft coordinate system of the pen's tip end is detected, the detectedvariation value of the acceleration is compared with the previouslydetermined threshold value, and an alarm signal is issued when thedetected variation value of the acceleration exceeds the predeterminedthreshold value and the variation amount comparing section judges theabove state, the possibility of the above error detection occurrence canbe notified to the user.

Furthermore, since the acceleration of the large variation value isremoved and the initial value of the rotational value of the pen shaftis calculated on the above condition, the movement direction and themovement distance of the pen's tip end can be calculated precisely evenwhere an abnormal input may occur.

The various functional blocks (sections) described above may beimplemented in computer hardware or software. When implemented insoftware a computer processor such as a microprocessor is programmed tocarry out the structural functions and operational steps describedherein. The software may be stored on a suitable recording medium, e.g.CD ROM, floppy disk, hard drive, etc. and may also be transmitted over anetwork for downloading and storage and later operation in a computerprocessor.

What is claimed is:
 1. A method for determining the movement of apen-shaped input device comprising the steps of: (a) detecting, withthree acceleration sensors, the acceleration of said input device in thex-axis, y-axis and z-axis direction in an input device coordinate systemwhere an axis of the input device is the Z axis, (b) detecting, withthree gyroscopes, the respective angular velocity around the x-axis,y-axis and z-axis, (c) detecting whether said input device is in awriting state; (d) calculating an initial value of an inclination angleof said input device in a gravity coordinate system, having a Z axisextending in a gravity acceleration direction, when said input device isnot in a writing state, using the outputs of said acceleration sensors,(e) calculating a variation in the inclination angle in the gravitycoordinate system using the outputs from the three gyroscopes when theinput device is in a writing state, (f) calculating an inclination angleof the input device in the gravity coordinate system using thecalculated initial value of the inclination angle and the calculatedinclination angle variation, (g) converting acceleration in the inputdevice coordinate system to acceleration in the gravity coordinatesystem using the inclination angle in the gravity coordinate systemcalculated in step (f), (h) calculating the movement direction andmovement distance of a tip end of said input device using theacceleration converted in step (g).
 2. The method of claim 1, furthercomprising the step of: (i) compensating the movement distance of saidtip end as calculated in step (h) to the movement distance on a writingsurface using an inclination formed between said writing surface andsaid gravity coordinate system.
 3. A method as in claim 1, furthercomprising the steps of: (i) filtering the output signals from saidacceleration sensors and gyroscopes to pass signals having a frequencycomponent associated with a writing operation using said input device;and (j) determining when said input device begins or ends a writingoperation based on the presence or absence of filtered signals havingsaid frequency component.
 4. A method as in claim 1, further comprisingthe step of: (i) calculating the value of an acceleration variationcaused by the inclination angle variation using the variation of theinclination angle in the gravity coordinate system of said input deviceas detected by the calculation of the inclination angle variation andthe mounting locations of said acceleration sensors and (j) compensatingthe acceleration output based on the calculated value of accelerationvariation, (k) in the acceleration conversion of step (g). performingacceleration conversion with the compensated acceleration outputs fromstep (j).
 5. A method as in claim 4 wherein step (i) further comprises:(l) calculating the centrifugal force caused by the inclination anglevariation on the basis of the variation velocity of the inclinationangle in the gravity coordinate system, said step (i) accelerationvariation being calculated on the basis of the calculated centrifugalforce.
 6. A method as in claim 1, further comprising the step of: (i)compensating for the difference between the coordinates of saidacceleration sensors on said writing surface and the coordinates of thetip end on the basis of the inclination angle in the gravity coordinatesystem and the mounting position of the acceleration sensors.
 7. Amethod for determining the movement of a tip of a pen-shaped inputdevice comprising the steps of: (a) detecting an inclination angle ofsaid input device in a coordinate system which has a writing surface asa reference surface; (b) detecting with three acceleration sensors theacceleration of said input device in an input device coordinate systemwhich has an axis of said input device as the Z axis, the detectedacceleration being in the X-axis, Y-axis and Z-axis directions, (c)converting acceleration in the input device coordinate system detectedby the acceleration sensors into acceleration in the coordinate systemwhich has the writing surface as a reference surface, using theinclination angle detected in step (a), and (d) calculating a movementdirection and movement distance at said tip end using the accelerationas converted in step (c).
 8. A method for determining the movement of atip end of a pen-shaped input device comprising the steps of: (a)detecting, with acceleration sensors, acceleration of said input devicein the Xs axis, Ys axis, and Zs axis directions in an input devicecoordinate system having a longitudinal axis of the input device as theZs axis, (b) detecting, with three gyroscopes, the rotational angularvelocities of said input device around the Xs, Ys and Zs axes, (c)calculating an initial value of an inclination angle of said inputdevice in a gravity coordinate system having Xg, Yg and Zg axes, withthe Zg axis being oriented in the gravity acceleration direction, usingthe acceleration detected by said acceleration sensors when said inputdevice is in a non-writing state, (d) calculating a variation of theinclination angle in the gravity coordinate system using the rotationalangle velocities detected by said gyroscopes when said input device isin a writing state, (e) calculating the inclination angle in the gravitycoordinate system of said input device, using the initial value of theinclination angle calculated in step (c) and the inclination anglevariation calculated in step (d), (f) compensating the detectedacceleration to more accurately portray acceleration at a tip end ofsaid input device using the mounting position of said accelerationsensors, the rotational angular velocities detected by said threegyroscopes in step (b), the inclination angle variation calculated instep (d), and the inclination angle calculated in step (e), (g)converting the compensated acceleration obtained in step (f) toacceleration in the gravity coordinate system, using the inclinationangle calculated in step (e), and (h) calculating a movement directionand movement distance using the converted acceleration obtained in step(g).
 9. A method as in claim 8, wherein said acceleration sensor for theXs-axis direction is disposed on the position of Ys=0, said accelerationsensor for the Ys-axis direction is disposed on the position of Xs=0,and said acceleration sensor for the Zs-axis direction is disposed onthe Zs axis.
 10. A method as in claim 8, wherein said respectiveacceleration sensors are arranged near the Zs axis.
 11. A method as inclaim 8, further comprising the steps of: (i) filtering the outputsignals from said three acceleration sensors and three gyroscopes todetect, in any of said output signals, a signal which is generated whensaid input device is in a writing mode and caused by the frictionbetween a tip end of said input device and a writing surface, and (j)determining that said input device is in a handwriting state when saidsignal generated by friction is detected, and that said input device isno longer in a handwriting state when said signal generated by frictionis not detected for a threshold period of time.
 12. A method as in claim11, further comprising the steps of: (i) extracting the orbit of the tipend of said input device from the beginning of a handwriting state tothe end thereof in accordance with the movement direction and movementdistance calculated in step (h), and (j) transferring an image of theorbit of said tip end extracted in step (i) onto an image writingsurface.
 13. A method as in claim 12, wherein step (h) calculates amovement distance in the Xg and Yg directions using the accelerationconverted in accordance with step (g), and step (i) extracts the orbitof the input device's tip end from the beginning to the end of ahandwriting state in accordance with the movement distance of the inputdevice's tip end in the Xg and Yg directions.
 14. A method fordetermining the movement of a pen-shaped input device comprising thesteps of: (a) detecting, with three acceleration sensors, theacceleration of said input device in the x-axis, y-axis and z-axisdirection in an input device coordinate system where an axis of theinput device is the Z axis, (b) detecting, with three gyroscopes, therespective angular velocities around the x-axis, y-axis and z-axis, (c)detecting whether said input device is in a state of handwriting ornon-handwriting, (d) calculating an initial value of a rotational angleof a tip end of said input device in a gravity coordinate system Xg, Yg,Zg having the Zg axis in the direction of gravity acceleration when saidtip end contacts a writing surface but said input apparatus is in astate of non-handwriting, said initial value of rotational angle beingcalculated using the acceleration detected in step (a), (e) calculatingthe variation of the rotational angle in the gravity coordinate systemof the input device on the basis of the angular velocities detected instep (b) when said input apparatus is detected as being in the state ofhandwriting, (f) calculating the rotational angle in the gravitycoordinate system of the input device using the initial value of therotational angle calculated in step (d) and the variation of therotational angle calculated in step (e), (g) converting the accelerationin the input device coordinate system detected in step (a) intoacceleration in the gravity coordinate system on the basis of therotational angle calculated in step (f), and (h) calculating themovement direction and distance of said tip end on the basis of theacceleration as converted in step (g).
 15. A method as in claim 14,wherein the detection in step (c) is made on the basis of the presenceor absence of a signal which indicates a writing operation which iscontained in one or more of the output signals from said accelerationsensors.
 16. A method as in claim 14, wherein the detection in step (c)is made on the basis of whether or not a pressure sensor senses a stresson said tip end caused by contact of said tip end with a writingsurface.
 17. A method as in any one of claims 14, 15, and 16 whereinstep (d) calculates the rotational angle of the input device in thegravity coordinate system several times when said input device is in astate of non-handwriting, and obtains an initial value of the rotationalangle of the input device when the tip end is brought into contact witha writing surface by averaging the results of the calculations.
 18. Amethod as in claim 14 further comprising the steps of: (i) detecting thevariation amount of the detected acceleration when said input device isin a state of non-handwriting, (j) comparing the variation amountdetected in step (i) with a predetermined threshold value, and (k)issuing an alarm signal when said comparison in step (j) indicates thatsaid variation amount exceeds said threshold.
 19. A method as in claim17 further comprising the steps of: (i) detecting the variation amountof the detected acceleration when said input device is in a state ofnon-handwriting, (j) comparing the variation amount detected in step (i)with a predetermined threshold value, and (k) issuing an alarm signalwhen said comparison in step (j) indicates that said variation amountexceeds said threshold.
 20. A method as in claim 18 wherein in step (d)the rotational angle of the input device in the gravity coordinatesystem is calculated several times using the detected acceleration whensaid input device is in the state of non-handwriting, excluding fromcalculation any acceleration which produces in step (j) an indicationthat said threshold has been exceeded.
 21. A method as in claim 20wherein in step (d) the rotational angle of the input device in thegravity coordinate system is calculated several times using the detectedacceleration when said input device is in the state of non-handwriting,excluding from calculation any acceleration which produces in step (j)an indication that said threshold has been exceeded.
 22. A method fordetermining the movement of a pen-shaped input device having a tip endcomprising the steps of: (a) detecting, with three acceleration sensors,the acceleration of the input device in an input device coordinatesystem, (b) detecting, with three gyroscopes, the angular velocity ofsaid input device about the axes in said input device coordinate system,(c) determining the movement direction and movement distance of said tipend in a gravity coordinate system based on the accelerations andangular velocities detected in steps (a) and (b).
 23. A method as inclaim 22, further comprising the step of: (d) compensating the movementdistance of said tip end on the basis of an inclination formed between awriting surface and said gravity coordinate system.
 24. A method as inclaim 22, further comprising the steps of: (d) detecting when saidinput-device is in a state of handwriting and non-handwriting, (e)calculating an initial inclination angle of said input device relativeto said gravity coordinate system when said input device is in a stateof non-handwriting, (f) using said initial inclination angle in thedetermination of the movement direction and movement distance in step(c).
 25. A method as in claim 24, wherein step (d) further comprises thesteps of: (g) filtering the output signals from at least saidacceleration sensors for a signal having a characteristic which isassociated with the movement of said input device across a writingsurface, and (h) using the presence or absence of said characteristicsignal to determine when said input device is in a state of handwritingor non-handwriting.
 26. A method as in claim 25, wherein step (g)filters the output signals from said acceleration sensors andgyroscopes.
 27. A method as in claim 14 further comprising the step of:(i) calculating the value of an acceleration variation caused by theinclination angle variation on the basis of the variation of theinclination angle in the gravity coordinate system of the input devicecalculated in step (e) and compensating the acceleration detected bysaid acceleration sensors, based on the acceleration variationcalculated in step (i), (j) performing step (g) using the compensatedacceleration.
 28. A method as in claim 27, wherein step (i) is carriedout by the steps of: (k) calculating centrifugal force on the basis ofthe variation velocity of the inclination angle in the gravitycoordinate system, (l) calculating a value of an acceleration variationcaused by the inclination angle variation on the basis of the calculatedcentrifugal force, and (m) compensating the acceleration detected by theacceleration sensors based on the calculated acceleration variation. 29.A method as in claim 14, further comprising the step of: (i)compensating the difference between the coordinates of the accelerationsensor on a writing surface and the coordinates of the input device tipend on the basis of the inclination angle in the gravity coordinatesystem of the input device and the mounting position of the accelerationsensors.
 30. A method as in claim 22 wherein step (c) further comprisesthe steps of: (d) converting acceleration obtained in step (a) toacceleration in the gravity coordinate system, and (e) using theconverted acceleration obtained in step (d) in determining the movementdirection and movement distance.
 31. A method for determining themovement of a pen-shaped input device having a tip end and alongitudinal axis comprising the steps of: (a) detecting, with threeacceleration sensors, the acceleration of the input device in an inputdevice coordinate system, (b) detecting, with three gyroscopes, theangular velocity of said input device about the axes in said inputdevice coordinate system, (c) calculating an initial value of aninclination angle of said input device in a gravity coordinate systemXg, Yg, Zg having an axis Zg extending in the gravity accelerationdirection using the acceleration detected in step (a), (d) calculating avariation of the inclination angle in the gravity coordinate system onthe basis of the angular velocities detected in step (b), (e)calculating a handwriting inclination angle in the gravity coordinatesystem of said input device on the basis of the initial value of theinclination angle calculated in step (c) and the inclination anglevariation calculated in step (d), (f) compensating the accelerationobtained from the acceleration sensors in step (a) tip based on themounting position of the acceleration sensors relative to the tip end,the rotational angular velocities detected by the gyroscopes in step(b), the inclination angle variation calculated in step (d), and theinclination angle of the input device calculated in step (e), (g)converting the acceleration in the input device coordinate system, ascompensated in step (f), to accelerations in the gravity coordinatesystem on the basis of the inclination angle of the input device in thegravity coordinate system calculated in step (e), and (h) calculatingthe movement direction and movement distance of the tip end of saidinput device based on the acceleration converted in step (g).
 32. Amethod for-determining the movement of a pen-shaped input device havinga tip end and a longitudinal axis comprising the steps of: (a) detectingacceleration of said input device in an input device coordinate systemXs, Ys, and Zs having the longitudinal axis of said input device as theZs axis, (b) detecting the rotational angular velocities of said inputdevice around the Xs, Ys and Zs axes, (c) detecting whether said inputdevice is in a state of handwriting or non-handwriting by detectingwhether the tip end of said input device is brought into contact with awriting surface, (d) calculating an initial rotation angle of said inputdevice in a gravity coordinate system (Xg, Yg, Zg) having the Zg axisextending in a gravity acceleration direction, when a state ofnon-handwriting is detected, and on the basis of the accelerationdetected in step (a).
 33. A method for determining the movement of apen-shaped input device having a tip end and a longitudinal axiscomprising the steps of: (a) detecting acceleration of said input devicein an input device coordinate system (Xs, Ys, Zs) having thelongitudinal axis of said input device as the Zs axis, (b) detecting therotational angular velocities of said input device around the Xs, Ys andZs axes, (c) detecting a state of handwriting or non-handwriting bydetecting whether said tip end is brought into contact with a writingsurface, (d) calculating the initial value of the rotation angle of theinput device in a gravity coordinate system (Xg, Yg, Zg) having an axisextending in the gravity acceleration direction as the Zg axis when theinput device tip end is brought into contact with the writing surface onthe basis of the acceleration detected in step (a), and when step (c)detects that said input device is in a state of non-handwriting, (e)calculating the variation of the rotational angle in the gravitycoordinate system (Xg, Yg, Zg) of the input device on the basis of therotational angles detected in step (b) when step (c) detects a state ofhandwriting, (f) calculating the rotational angle in the gravitycoordinate system (Xg, Yg, Zg) of the input device on the basis of theinitial value of the rotational angle calculated in step (d) and thevariation in rotational angle calculated in step (e).
 34. A method fordetermining the movement of a pen-shaped input device having a tip endand a longitudinal axis comprising the steps of: (a) detectingacceleration of the input device shaft in a coordinate system (X, Y, Z)having the pen shaft as the Z axis, (b) detecting the angular velocitiesof the input device around the X, Y and Z axes, (c) determining themovement of said input device, including determining whether said inputdevice is in a state of handwriting or not, said determination ofwhether said input device is in a state of handwriting or not beingdetermined by the further steps of: (d) filtering a characteristicfrequency component from output signals from the acceleration sensorsused in the step (a) detection, and the gyroscopes used in the step (b)detection, said characteristic frequency component being present in atleast one of said output signals when said input device is in a state ofhandwriting, and (e) determining that said input device is in the stateof handwriting when said characteristic frequency component is presentin any of said filtered output signals.
 35. A method as in claim 34,wherein said characteristic frequency component is in the neighborhoodof 10 Hz.
 36. A method as in claim 34, wherein said characteristicfrequency component is caused by the friction between said tip end ofsaid input device and a writing surface.
 37. A method as in claim 34,wherein step (e) determines the beginning of a handwriting operationwhen said characteristic frequency component first appears in one ofsaid output signals, and determines the end of a handwriting operationwhen said characteristic frequency component is absent from all of saidoutput signals.
 38. A method for determining the movement of a en-shapedinput device having a tip end and a longitudinal axis comprising thesteps of: (a) detecting, with three acceleration sensors, theacceleration of the input device in an input device coordinate system,(b) detecting, with three gyroscopes, the angular velocity of said inputdevice about the axes in said input device coordinate system, (c)calculating an initial value of the inclination angle of the inputdevice in a gravity coordinate system having an axis extending in thegravity acceleration direction as the Z axis, on the basis ofacceleration detected in step (a), when said input device is in a stateof non-handwriting, (d) calculating a variation of the inclination anglein the gravity coordinate system on the basis of the angular velocitydetected in step (b) when the input device is in a state of handwriting,(e) calculating the inclination angle in the gravity coordinate systemof the input device, on the basis of the initial value of theinclination angle calculated in step (c) and the inclination anglevariation calculated in step (d), (f) converting the accelerationdetected in step (a) to acceleration in the gravity coordinate system onthe basis of the inclination angle in the gravity coordinate systemcalculated in step (e), and (g) calculating a movement direction andmovement distance at the tip end of the input device on the basis of theacceleration converted in step (f).